The Wayback Machine - https://web.archive.org/web/20240713071654/https://www.geeksforgeeks.org/sum-of-squares/
Open In App

Sum of Squares

Last Updated : 10 Jun, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Sum of squares in the addition of the square of the numbers i.e. we find the sum of squares by first finding the individual squares and then adding them to find the sum of the squares. We define the sum of squares in statistics as the variation of the data set. In algebra, we can find the sum of squares for two terms, three terms, or “n” number of terms, etc. We can find the sum of squares of two numbers using the algebraic identity,

  •  (a + b)2 = a2 + b2 + 2ab

We can also find the sum of squares of more than two terms using the concept of Algebra and Mathematical Induction. In this article, we will learn about the different sum of squares formulas, their examples, proofs, and others in detail.

What is Sum of Squares?

Sum of squares is the method in statistics that helps evaluate the dispersion of the given data set. The sum of squares is found by taking individual squares of the terms and then adding them to find their sum. In algebra, algebraic identity (a+b)2 = a2 + b2 + 2ab gives the sum of squares of two numbers. The general formula to calculate the sum of natural numbers is:

Sum-of-Squar-Formula

Sum of Square Formula

Now let’s discuss all the formulas used to find the sum of squares in algebra and statistics.

Sum of Squares Formula

Sum of squares represents various things in various fields of Mathematics, in Statistics it represents the dispersion of the data set, which tells us how the data in a given set varies to the mean of the data set. The sum of the square formula in various fields of Mathematics is,

In Statistics: Sum of Squares (of n values) = ∑ni=0 (xi – x̄)2 where x̄ is the mean of n-values.

In Algebra: Sum of Squares = a2 + b2 = (a + b)2 – 2ab

Sum of Squares of n Natural Numbers: 12 + 22 + 32 + … + n2 = [n(n+1)(2n+1)] / 6

We can easily find the sum of squares for two numbers, three numbers, and n numbers. Also, we can find the sum of squares of n natural numbers, etc.

Sum of Squares for Two Numbers

Let a and b be two real numbers, then the sum of squares for two numbers formula is,

a2 + b2 = (a + b)2 − 2ab

This formula can be obtained using the algebraic identity of (a+b)2

We know that,

(a + b)2 = a2 + 2ab + b2

Subtracting 2ab on both sides

(a + b)2 − 2ab = a2 + 2ab + b2 − 2ab

⇒a2 + b2 = (a + b)2 − 2ab

Thus, the required formula is obtained.

Sum of Squares for Three Numbers

Let a, b, and c be three real numbers, then the sum of squares for three numbers formula is,

a2 + b2 + c2 = (a +b + c)2 – 2ab – 2bc – 2ca

This formula can be obtained using the algebraic identity of (a+b+c)2

We know that,

(a + b + c)2 = a2 +  b2 + c2 + 2ab + 2bc + 2ca

Subtracting 2ab, 2bc, and 2ca on both sides,

a2 + b2 + c2 = (a + b + c)2 − 2ab − 2bc − 2ca

Thus, the required formula is obtained.

Sum of Squares for “n” Natural Numbers

Natural numbers are also known as positive integers and include all the counting numbers, starting from 1 to infinity. If 1, 2, 3, 4,… n are n consecutive natural numbers, then the sum of squares of “n” consecutive natural numbers is represented by 12 + 22 + 32 +… + n2 and symbolically represented as Σn2.

Sum of Square of n Natural Numbers = Σn2 = 12 + 22 + 32 +… + n2

The required sum of squares for ‘n’ natural number formula is,

[Tex]\bold{\sum{n^2}= \frac{n(n+1)(2n+1)}{6}} [/Tex]

This formula is proved using Mathematical Induction Method.

Sum of Squares of First “n” Even Numbers

The formula for the sum of squares of the first “n” even numbers, i.e., 22 + 42 + 62 +… + (2n)2 is given as follows:

∑(2n)2 = 22 + 42 + 62 +… + (2n)2

[Tex]\bold{\sum{(2n)^2}= \frac{2n(n+1)(2n+1)}{3}} [/Tex]

This formula can be obtained using,

∑(2n)2 = ∑4n2 = 4∑n2

As [Tex]\sum{n^2}= \frac{n(n+1)(2n+1)}{6} [/Tex]

Thus, ∑(2n)2 = 2[n(n+1)(2n+1)]/3

Which is the required formula.

Sum of Squares of First “n” Odd Numbers

Formula for the sum of squares of the first “n” odd numbers, i.e., 12 + 32 + 52 +… + (2n – 1)2, can be derived using the formulas for the sum of the squares of the first “2n” natural numbers and the sum of squares of the first “n” even numbers.

∑(2n-1)2 = 12 + 32 + 52 + … + (2n – 1)2

[Tex]\bold{\sum{(2n-1)^2}= \frac{n(2n+1)(2n-1)}{3}} [/Tex]

This formula can be obtained using,

∑(2n –1)2 = [12 + 22 + 32 + … + (2n – 1)2 + (2n)2] – [22 + 42 + 62 + … + (2n)2]

Now, applying the formula for sum of squares of “2n” natural numbers and “n” even natural numbers,

∑(2n–1)2 = 2n/6 (2n + 1)(4n + 1) – (2n/3) (n+1)(2n+1)

⇒ ∑(2n–1)2 = n/3 [(2n+1)(4n+1)] – 2n/3 [(n+1)(2n+1)]

⇒ ∑(2n–1)2 = n/3 (2n+1) [4n + 1 – 2n – 2]

⇒ ∑(2n–1)2 = [n(2n+1)(2n–1)]/3

Thus, the required formula is verified.

Sum of Squares in Statistics

In statistics, the value of the sum of squares tells the degree of dispersion in a dataset. It evaluates the variance of the data points from the mean and helps for a better understanding of the data. The large value of the sum of squares indicates that there is a high variation of the data points from the mean value, while the small value indicates that there is a low variation of the data from its mean. 

The formula used to calculate the sum of squares in Statistics is,

Sum of Squares of n Data points = ∑ni=0 (xi – x̄)2

where,

  • ∑ represents Sum of Series
  • xi represents each value in Set
  • x̄ represents Mean of Values
  • (xi – x̄) represents Deviation from Mean Value
  • n represents Number of Terms in Series

Steps to Find Sum of Squares

Follow the steps given below to find the Total Sum of Squares in Statistics.

Step 1: Count the number of data points in the given dataset. (say n)

Step 2: Find the mean of the given data set.

Step 3: Find the definition of the data set from the mean value.

Step 4: Find the square of deviation of individual terms.

Step 5: Find the sum of all the square values.

Sum of Squares Error

Sum of Square Error (SSE) is the difference between the observed value and the predicted value of the deviation of the data set. SSE is also called the SSR or sum of square residual. The formula to calculate the sum of square error is,

SSE = ∑ni=0 (yi – f(xi))2

where, 

  • yi is the ith Value of Variable to be Predicted
  • f(xi) is the Predicted Value
  • xi is the ith value of the explanatory variable

Sum of Square Error can also be calculated using the formula,

SSE = SST – SSR

Where,

  • SST is Sum of Squares Total
  • SSR is Sum of Squares Regression

Sum of Square Table

Sum of the square table is added below,

Sum of Squares

Sum of Square Table

Read More,

Examples on Sum of Square Formulas

Example 1: Find the sum of the given series: 12 + 22 + 32 +…+ 552.

Solution:

To find the value of 12 + 22 + 32 +…+ 552.

Sum of Squares Formula for n terms

∑n2 = 12 + 22 + 32 +…+ n2 = [n(n+1)(2n+1)] / 6

Given, n = 55

Sum of Squares = [55(55+1)(2×55+1)] / 6

⇒ Sum of Squares = (55 × 56 × 111) / 6

⇒ Sum of Squares = 56,980‬

Thus, the sum of the given series 12 + 22 + 32 +…+ 552 is 56,980‬.

Example 2: Find the value of (32 + 82), using the sum of squares formula.

Solution:

Find 32 + 82 using sum of square formula,

Given, 

  • a = 3
  • b = 8

Using sum of square formula,

a2 + b2 = (a + b)2 − 2ab

⇒ 32 + 82 = (3 + 8)2 − 2(3)(8)

⇒ 32 + 82 = 121 – 2(24)

⇒ 32 + 82 = 121 − 48

⇒ 32 + 82 = 73.

Thus, the value of (32 + 82) is 73.

Example 3: Find the sum of squares of the first 25 even natural numbers.

Solution:

Sum of Squares of first 25 Even Natural Numbers(S) = 22 + 42 + 62 +… + 482+ 502……(1)

Now simplifying eq(1)

S = 22( 12 + 22 + 32 +…+252)

Using Sum Squares Formula for n terms, we have

∑n2 = [n(n+1)(2n+1)]/6

Here, n = 25

S= 22( 12 + 22 + 32 +…+252) = 4[25(25+1)(2(25)+1)/6]

⇒ S = (2/3) × (25) × (26) × (51)

⇒ S = 22100

Hence, the sum of squares of the first 25 even natural numbers is 22100.

Example 4: A dataset has points 2, 4, 13, 10, 12, and 7. Find the sum of squares for the given data.

Solution: 

Given,

We have 6 data points 2, 4, 13, 10, 12, and 7.

Sum of given data points = 2 + 4 + 13 + 10 + 12 + 7 = 48. 

Mean of the given data,

Mean, x̄ = (Sum of data value) / (Number of data value)

⇒ x̄ = 48 / 6

⇒ x̄ = 8

Now,

∑ni=0 (xi – x̄)2 = (2 – 8)2 + (4 – 8)2 + (13 – 8)2 + (10 – 8)2 + (12 – 8)2 + (7 – 8)2

⇒ ∑ni=0 (xi – x̄)2 = (–6)2 + (–4)2 + (5)2 + (2)2 + (4)2 + (–1)2

⇒ ∑ni=0 (xi – x̄)2 = 36 + 16 + 25 + 4 + 14 + 1

⇒ ∑ni=0 (xi – x̄)2 = 96

Hence, the sum of squares for the given data is 96.

Example 5: Find the sum of the squares of 4, 9, and 11 using the sum of squares formula for three numbers.

Solution: 

Given,

  • a = 4
  • b = 9
  • c = 11

Using Sum of Squares Formula,

a2 + b2 + c2 = (a + b +c)2 − 2ab − 2bc − 2ca

⇒ 42 + 92 + 112 = (4 + 9 + 11)2 −(2×4×9) − (2×9×11) − (2×11×4)

⇒ 42 + 92 + 112 = 576 − 72 − 198 − 88

⇒ 42 + 92 + 112 = 218

Hence, the value of (42 + 92 + 112) is 218.

Example 6: Find the sum of squares of the first 10 odd numbers.

Solution:

Sum of Squares of the first 10 odd numbers (S): 12 + 32 + 52 +… +172 + 192

Sum of squares of first “n” Odd Numbers ∑(2n–1)2 = [n(2n+1)(2n–1)]/3

Here, n is 10.

S = [10×(2×10 + 1)(2×10 – 1)]/3

⇒ S = [10 × 21 × 19]/3

⇒ S = 10 × 7 × 19 = 1330

Hence, the value of the sum of squares of the first 10 odd numbers is 1330.

FAQs on Sum of Squares

What is Sum of Squares Definition?

In statistics sum of squares is a tool that evaluates the dispersion of a dataset. We can easily calculate the sum of squares by first individually finding the square of the terms and then adding them to find their sum.

What is Sum of Squares Error?

Sum of Square Error (SSE) is the difference between the actual value and the predicted value of the data set. It is also called the Residual Sum of the Square.

What is Total Sum of Squares?

The sum of squares of the difference of each data point from the mean value of the data point is called the Total Sum of Squares or simply the Sum of squares. It is calculated using the formula,

TSS = ∑ni=0 (xi – x̄)2

What is the Expansion of Sum of Squares Formula?

The formula to find the value of a2 + b2 is called the sum of squares formula in algebra and it is calculated as,

a2 + b2 = (a + b)2 – 2ab

What are Sum of Squares Formula used in Algebra?

Various sum of squares formulas used in algebra are,

  • a2 + b2 = (a + b)2 − 2ab
  • a2 + b2 + c2 = (a +b + c)2 − 2ab − 2bc − 2ca


Similar Reads

Residual Sum of Squares
Residual Sum of Squares is one of the types of sum of squares in regression which is used to measure the dispersion of the data points. The sum of squares can also be used to calculate the variance in the values of assets in the case of accounting. If the value of the sum of squares is higher, it represents a higher variance from the mean value and
6 min read
How to find the Sum and Difference of Squares?
The arithmetic value which is used for representing the quantity and used in making calculations are defined as NUMBERS. A symbol like “4, 5, 6” which represents a number is known as numerals. Without numbers, counting things is not possible, date, time, money, etc. these numbers are also used for measurement and used for labeling. The properties o
10 min read
How to Find Sum of Squares from Standard Deviation?
Answer: The sum of squares can be found by squaring the standard deviation and then multiplying it by the number of observations.The sum of squares (SS) is a measure of the spread or variability of a set of values. It can be calculated from the standard deviation (SD), which is another measure of the dispersion of data points. Here's the detailed e
2 min read
How to calculate the sum of squares?
The number system includes different types of numbers for example prime numbers, odd numbers, even numbers, rational numbers, whole numbers, etc. These numbers can be expressed in the form of figures as well as words accordingly. For example, numbers like 40 and 65 expressed in the form of figures can also be written as forty and sixty-five. A Numb
5 min read
Sum of Squares of n Natural numbers
Sum of Squares of n Natural numbers: The sum of squares of n natural numbers is calculated using the formula [n(n+1)(2n+1)] / 6 where 'n' is a natural number. There are formulas for calculating the sum of squares of first n even numbers as well as first n odd numbers. In this article, we have covered the sum of squares of the 'n' natural number for
11 min read
Class 8 NCERT Solutions - Chapter 6 Squares and Square Roots - Exercise 6.1
Problem 1: What will be the unit digit of the squares of the following numbers? Solution: To find the unit digit of the square of any number, find the square of the unit digit of that number and its unit digit will be the unit digit of the square of the actual number. eg:- if a number is 2007, the square of the unit digit of 2007 is 49 (7 square).
6 min read
Class 8 RD Sharma Solutions - Chapter 3 Squares and Square Roots - Exercise 3.3 | Set 1
Question 1. Find the square of the following numbers using column method. Verify the squares using the usual multiplication.(i) 25 Solution: Here, we will break 25 in as between one's and ten's position as a = 2 and b = 5. Now, Step 1: Make 3 columns and write the values of a², 2ab, b² in these columns. Column 1Column 2Column 3 a2 2ab b2 4 20 25 St
5 min read
Class 8 NCERT Solutions - Chapter 6 Squares and Square Roots - Exercise 6.2
Question 1. Find the square of the following numbers. (i) 32 (32)2 = (30 + 2)2 = (30)2 + (2)2 + 2 × 30 × 2 [Since, (a + b)2 = a2 + b2 + 2ab] = 900 + 4 + 120 = 1024 (ii) 35 (35)2 = (30 + 5)2 = (30)2 + (5)2 + 2 × 30 × 5 [Since, (a + b)2 = a2 + b2 + 2ab] = 900 + 25 + 300 = 1225 (iii) 86 (86)2 = (90 - 4)2 = (90)2 + (4)2 - 2 × 90 × 4 [Since, (a - b)2 =
3 min read
Class 8 RD Sharma Solutions - Chapter 3 Squares and Square Roots - Exercise 3.1 | Set 1
Question 1. Which of the following numbers are perfect squares? (i) 484 Solution: Prime factorization of 484 is 484 = 2×2×11×11 By grouping prime factors = (2×2) × (11×11) Proper pairing of all the factors Therefore, 484 is a perfect square. (ii) 625 Solution: Prime factorization of 625 625 = 5×5×5×5 By grouping the prime factors = (5×5) × (5×5) Pr
10 min read
Class 8 RD Sharma Solutions - Chapter 3 Squares and Square Roots - Exercise 3.1 | Set 2
Chapter 3 Squares and Square Roots - Exercise 3.1 | Set 1Question 9. Find the greatest number of two digits which is a perfect square. Solution: Greatest two-digit number is 99 99 = 81+18 = 9×9 + 18 18 is the remainder Perfect square number is 99 - 18 = 81 Therefore, the greatest number of two digits which is perfect square is 81 Question 10. Find
2 min read