With so many people working from home due to the coronavirus epidemic, it has become necessary for individuals and businesses to use a reliable VPN to enhance security. This is the one Trans4mind recommends... Article: Ivacy Virtual Private Network Review

# 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: Main Series Page

### 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 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: ### 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: Saying the sum to n is one term less than the sum to (n+1)

We expand the sums: As expected, the cubic terms cancel, and we rearrange the formula to have the sum of the squares on the left: Expanding the cube and summing the sums:  Dividing throughout by 3 gives us the formula for the sum of the squares:

Or: ### 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). 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: [3.1]
Where 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: [3.2]

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

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

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

From 3.3, we get: [3.7]

Expressing the errors in terms of n: [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: [3.9]

And the nth term is: [3.10]

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

Simplifying: [3.12]

Remembering: [3.13]

Substituting 3.12 in 3.13, we get the formula for the sum of the squares of the first n natural numbers: [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. 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: [4.1]

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

Integrating: [4.3]

Expanding terms: Collecting like terms: [4.4]

And summing: [4.5]

The error is: [4.6]

Substituting 4.6 for En in 4.1: [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: [5.1]

Beginning to unwind: [5.2]

Continuing to unwind: [5.3]

Writing the nth term: [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: [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

Tech Tip: Now build high quality math projects and work on them remotely from anywhere on any device (PC/Mac/android/iOS) at ease of comfort by loading your essential Mathematics software onto a powerful hosted xendesktop available at an affordable xendesktop cost. Also, keep track of all your financial records and data remotely from anywhere on any device with QuickBooks Cloud Hosting from Apps4Rent.

Ken Ward's Mathematics Pages

# Faster Arithmetic - by Ken Ward

Ken's book is packed with examples and explanations that enable you to discover more than 150 techniques to speed up your arithmetic and increase your understanding of numbers. Paperback and Kindle: 