Sum of Squared Integers


This will simply show how to sum all squared integers, 1 + 4 + 9 ... + n2, let this be S2n. Let the sum of integers be Sn Take the expression
(x - 1)3 = x3 - 3x2 + 3x - 1
This can be re-arranged to
x3 - (x - 1)3 = 3x2 - 3x + 1
Now if we sum each side from 1 to n, all the terms on the left would cancel leaving just n3
n3 - (n - 1)3 + (n - 1)3 - (n - 2)3 + (n - 2)3 - (n - 3)3 + .......... + 1 - 0
Hence
n3 = 3S2n - 3Sn + n
We already know that Sn = n/2 (n + 1), therefore
3S2n = n3 + 3n/2 (n + 1) - n
Hence
3S2n = n/2(2n2 + 3n + 1) = n/2(n + 1)(2n + 1)
Resulting in the expression
S2n = n/6(n + 1)(2n + 1)
Updated: 10/12/2023