nav.gif (1245 bytes)mathematics

Ken Ward's Mathematics Pages

Series - Sum of the Squares of the First n Natural Numbers

The sum of the squares of the first n natural numbers is:
sumSquaresNatNumbersFormulae.gif
Main Series Page

Contents

  1. Sum to n of the Squares of Natural Numbers Using Differences
  2. Sum of the squares of the first n natural numbers using summation
  3. Sum of Natural Numbers Squared Using Errors
  4. Using Infinite Calculus to find the Sum of the Squares of the First n Natural Numbers
  5. Summing the first n natural numbers by finding a general term

Sum to n of the Squares of Natural Numbers Using Differences

We can use the same trick here that we used with the sum of the natural numbers, using differences.

n 0 1 2 3 4 5 6
n2 0 1 4 9 16 25 36
Sn 0 1 5 14 30 55 91
Δ1
1 4 9 16 25 36
Δ2

3 5 7 9 11
Δ3


2 2 2 2

As usual, the first n in the table is zero, which isn't a natural number.
Because Δ3 is a constant, the sum is a cubic of the form
an3+bn2+cn+d, [1.0]

and we can find the coefficients using simultaneous equations, which we can make as we wish, as we know how to add squares to the table and to sum them, even if we don't know the formula.

In the table below, we create three equations, noting that d=0 from the first one (revealing the reason for the non-natural number zero)

n 0 1 2 3
Sn 0 1 5 14

d=0 a+b+c=1 8a+4b+2c=5 27a+9b+3c=14

Rewriting our equations:
a+b+c=1 [1.1]
8a+4b+2c=5 [1.2]
27a+9b+3c=14 [1.3]

Using 1.1 with 1.2 and 1.3 we can make two new equations:
6a+2b=3 [1.4]
24a+6b=11 [1.5]

By subtracting 3x Equation 1.4 from 1.5, we get:
6a=2
So a=1/3 [Also noting, by the way, that Δ3/3!=1/3]

Substituting a=1/3 in 1.4 gives
2b=1
So b=1/2

Finally, substituting these values into 1.1 we get
1/3+1/2+c=1
So c=1/6

[Actually, with the sum of the powers, the sum of the coefficients in the formula is always 1]

So, we can substitute our values into 1.0, to get the sum of the squares of the first n natural numbers (or first n positive integers):
n3/3+n2/2+n/6
Or, in various forms:
sumSquaresNatNumbersFormulae.gif

Sum of the squares of the first n natural numbers using summation

We tried this with the sum of the natural numbers using summation, and fell flat on our faces, so this time we will go straight into setting up for the sum of the cubes, in the hope we will find our formula for the squares. (There is no reason stated here why this method should continue to work, however. Sometimes such approaches work only in specific cases. Fortunately, this approach does work for any sum of the powers of the natural numbers).

As before, we set up as follows:
sumSquares1.gif
Saying the sum to n is one term less than the sum to (n+1)

We expand the sums:
sumSquares2.gif

As expected, the cubic terms cancel, and we rearrange the formula to have the sum of the squares on the left:
sumSquares3.gif
Expanding the cube and summing the sums:
sumSquares4.gif
Adding like terms:
sumSquares5.gif
Dividing throughout by 3 gives us the formula for the sum of the squares:




Or:
sumSquares7.gif

Sum of Natural Numbers Squared Using Errors

When we did this with the natural numbers, we found there was little work to do. With the squares, we have to go a little further. While the error on each term for the sum of the numbers is constant, the error on the squares depends on the term.

The graph below of y=x2, has the squares of the natural numbers represented by rectangles, and the area under the graph is approximately the sum of the squares (areas of the rectangles).

sumSquaresGraph.gif
By integrating the x2, we find the area under the graph to be x3/3, so the area of the rectangles (sum of squares) is the area under the graph plus the error. If the number of squares is n, we can write n3/3 as the approximation:
sumSquaresErrors2.gif [3.1]
Where sumSquaresSymbol.gif is the sum of the squares and En is the error on approximating to n3/3.

The sum of the n-1 squares and the error En-1, gives us:
sumSquaresErrors3.gif [3.2]

We note that the difference between 3.1 and 3.2 is;
sumSquaresErrors.gif [3.3]
being the nth square

The difference between 3.1 and 3.2 is also:
sumSquaresErrors5.gif [3.4]

Expanding (n-1)3 in 3.4:
sumSquaresErrors6.gif [3.5]
Rounding up similar terms:
sumSquaresErrors7.gif [3.6]

From 3.3, we get:
sumSquaresErrors7.gif [3.7]

Expressing the errors in terms of n:
sumSquaresErrors9.gif [3.8]

This is a recursion formula. If we know one of the errors we can find the other. We do know what E0 is, because it is the error on the 0th term, which is zero. So, letting n=1, we have:
E1-E0=1-1/3

Letting n=2, and changing the relationship a bit:
E2=E1+2-1/3
E2=1-1/3+2-1/3

Similarly,
E3=1-1/3+2-1/3+3-1/3
Or:
E3=1+2+3-3(1/3)

So we can generalise, the k-th term is:
sumSquaresErrors10.gif [3.9]

And the nth term is:
sumSquaresErrors11.gif [3.10]

We know the sum of the first n natural numbers,
(sumNatNumbersFormula.gif)
so we can calculate (write down) the summation in 3.10 and put the result in
sumSquaresErrors12.gif [3.11]

Simplifying:
sumSquaresErrors13.gif [3.12]

Remembering:
sumSquaresErrors14.gif [3.13]

Substituting 3.12 in 3.13, we get the formula for the sum of the squares of the first n natural numbers:
sumSquaresErrorsFinalFormula.gif [3.14]

Using Infinite Calculus to find the Sum of the Squares of the First n Natural Numbers

We used this approach with the sum of the natural numbers.

The following graph is of y=x2, and the rectangles represent the sum of the squares.

sumSquaresGraph.gif

y=x2 represents part of the sum of the squares, and the rest is the area between each rectangle and the function.

Looking at the graph, it seems the difference, or error En, varies; at first it seems bigger than the term, and it gradually gets less.

The sum of the squares, where En is the error:
squaresCalc1.gif [4.1]

The error is the area of each square less the area under the graph:
squaresCalc2.gif [4.2]

Integrating:
squaresCalc3.gif [4.3]

Expanding terms:
squaresCalc4.gif

Collecting like terms:
squaresCalc5.gif [4.4]

And summing:
squaresCalc7.gif [4.5]

The error is:
squaresCalc6.gif [4.6]

Substituting 4.6 for En in 4.1:
squaresCalc8.gif [4.7]

Summing the squares of the first n natural numbers by finding a general term (fails)

While this worked for the sum of the natural numbers, it does not work in the following example.

Set up for generalising:
squaresGenTerm1.gif [5.1]

Beginning to unwind:
squaresGenTerm2.gif [5.2]

Continuing to unwind:
squaresGenTerm3.gif[5.3]

Writing the nth term:
squaresGenTerm4.gif [5.4]

(nn2=n3, of course)

It is now evident that the sum of the squares on both sides will cancel out. We could get a sum for the natural numbers out of this, but we can do that directly and much more easily.

After some thought, we can conclude that the last term must be negative for us to find an expression for the sum of the squares. It was negative for the sum of the natural numbers, and it will be negative again for the sum of the cubes, but will not work for the sum of the powers of four. That is, this method works for the squares of the odd numbers.

The expression corresponding to 5.4 for the sum of the cubes is:
squaresGenTerm5.gif [5.5]

Here the sum of the cubes on the right-hand-side is negative. I also note that in 5.4 and 5.5 the coefficients correspond to the binomial coefficients of the  square  and the cubic





Ken Ward's Mathematics Pages