Advanced Math/Sum of squares formula
Follow-Ups to Answer from Expert Paul Klarreich
William wrote at 2007-06-14 23:11:54
Use (1+n)^3 = 1 + 3n + 3n^2 + n^3
n^3 = 1 + 3(n-1) + 3(n-1)^2 + (n-1)^3
.
2^3 = 1 + 3 + 3 + 1
Sum up =>
-1+(1+...+n^3)+(1+n)^3=n+3(1+...+n)+3(1+...+n^2)
+(1+...+n^3)
cancel some terms out =>
-1+(1+n)^3=n+3*n(n+1)/2+3(1+...+n^2)
then the rest is easy work out (1+...+n^2)
Same way using (1+n)^4 can work out
(1+...+n^3)
Paul Klarreich wrote at 2007-07-07 03:38:16
Indeed, this is a very nice approach. I can't remember ever having seen it before. It works out as shown below. I felt it necessary to work out all the algebra just to see if I can still do it, and having done it, I might as well send it along.
(1+n)^3 = 1 + 3n + 3n^2 + n^3
n^3 = 1 + 3(n-1) + 3(n-1)^2 + (n-1)^3
(n-1)^3 = 1 + 3(n-2) + 3(n-2)^2 + (n-2)^3
...
2^3 = 1 + 3(1) + 3(1)^2 + 1^3
1^3 = 1 + 3(0) + 3(0) + 0^3
-------------------------------------------------
1^3 + 2^3 + ... + n^3 + (n+1)^3 =
n+1 + 3(1 + ... + n) + 3(1^2 + ... + n^2) + (1^3 + ... + n^3)
Now the sum of cubes will cancel:
(n+1)^3 = n+1 + 3(1 + ... + n) + 3(1^2 + ... + n^2)
And this is what we seek: ***************
The sum of 1..n can be rewritten:
(n+1)^3 = n+1 + 3(n(n + 1)/2) + 3(SUM OF SQUARES)
Now some algebra:
n^3 + 3n^2 + 3n + 1 - n - 1 - 3(n(n + 1)/2) = 3(SUM OF SQUARES)
n^3 + 3n^2 + 2n - 3(n^2 + n)/2) = 3(SUM OF SQUARES)
[2n^3 + 6n^2 + 4n - 3n^2 - 3n)]/2 = 3(SUM OF SQUARES)
[2n^3 + 3n^2 + n ]/2 = 3(SUM OF SQUARES)
[2n^3 + 3n^2 + n ]/6 = (SUM OF SQUARES)
[n(2n^2 + 3n + 1]/6 = (SUM OF SQUARES)
[n(2n + 1)(n + 1)]/6 = (SUM OF SQUARES)
and that is the formula.
Karoye wrote at 2010-08-25 18:32:06
Esta fórmula es el resultado del método de las diferencias finitas, el cual es a la vez la comprobación de la misma.