Sums of squares, cubes, and fourth powers: formulas and proofs

Original publication: Updated:

The three formulas

For a positive integer nn,

∑k=1nk2=n(n+1)(2n+1)6,\boxed{\sum_{k=1}^n k^2=\frac{n(n+1)(2n+1)}6,} ∑k=1nk3=n2(n+1)24,\boxed{\sum_{k=1}^n k^3=\frac{n^2(n+1)^2}4,} ∑k=1nk4=n(n+1)(2n+1)(3n2+3n−1)30.\boxed{\sum_{k=1}^n k^4=\frac{n(n+1)(2n+1)(3n^2+3n-1)}{30}.}

The same formulas hold for n=0n=0 if the sums are interpreted as empty sums. Here we derive them, rather than treating them as unrelated facts to memorize.

The common idea is to evaluate a sum of differences in two ways: telescope it, and expand each difference. We use the familiar identity ∑k=1nk=n(n+1)/2\sum_{k=1}^n k=n(n+1)/2.

Deriving the sum of squares

Start with

(k+1)3−k3=3k2+3k+1.(k+1)^3-k^3=3k^2+3k+1.

Summing from k=1k=1 to nn, the left side telescopes:

∑k=1n{(k+1)3−k3}=(n+1)3−1.\sum_{k=1}^n\{(k+1)^3-k^3\}=(n+1)^3-1.

If S2=∑k=1nk2S_2=\sum_{k=1}^n k^2, the expanded right side is

3S2+32n(n+1)+n.3S_2+\frac32n(n+1)+n.

Equating the two evaluations and solving for S2S_2 gives

S2=(n+1)3−1−32n(n+1)−n3=n(n+1)(2n+1)6.S_2=\frac{(n+1)^3-1-\frac32n(n+1)-n}{3}=\boxed{\frac{n(n+1)(2n+1)}6.}

The cancellation is explained in more detail in telescoping sums.

Deriving the sum of cubes

Use the next power:

(k+1)4−k4=4k3+6k2+4k+1.(k+1)^4-k^4=4k^3+6k^2+4k+1.

Let S3=∑k=1nk3S_3=\sum_{k=1}^n k^3. Summation gives

(n+1)4−1=4S3+6S2+4n(n+1)2+n.(n+1)^4-1=4S_3+6S_2+4\frac{n(n+1)}2+n.

Substitute the square-sum formula:

(n+1)4−1=4S3+n(n+1)(2n+1)+2n(n+1)+n.(n+1)^4-1=4S_3+n(n+1)(2n+1)+2n(n+1)+n.

Rearranging and factoring yields

S3=n2(n+1)24=(∑k=1nk)2.\boxed{S_3=\frac{n^2(n+1)^2}4=\left(\sum_{k=1}^n k\right)^2.}

Thus the sum of the first nn cubes is the square of the sum of the first nn positive integers.

Deriving the sum of fourth powers

Start with

(k+1)5−k5=5k4+10k3+10k2+5k+1.(k+1)^5-k^5=5k^4+10k^3+10k^2+5k+1.

Writing S4=∑k=1nk4S_4=\sum_{k=1}^n k^4 gives

(n+1)5−1=5S4+10S3+10S2+5n(n+1)2+n.(n+1)^5-1=5S_4+10S_3+10S_2+5\frac{n(n+1)}2+n.

Substitute the results already obtained:

(n+1)5−1=5S4+52n2(n+1)2+53n(n+1)(2n+1)+52n(n+1)+n.\begin{aligned} (n+1)^5-1={}&5S_4+\frac52n^2(n+1)^2\\ &+\frac53n(n+1)(2n+1)+\frac52n(n+1)+n. \end{aligned}

Solving for S4S_4 and factoring the polynomial gives

S4=n(n+1)(2n+1)(3n2+3n−1)30.\boxed{S_4=\frac{n(n+1)(2n+1)(3n^2+3n-1)}{30}.}

The pattern continues: the difference of consecutive (r+1)(r+1)st powers contains a leading term (r+1)kr(r+1)k^r and lower powers. Once their sums are known, the same procedure finds the sum of rrth powers.

Proving a known formula by induction

Derivation explains how to discover a formula. If the formula is already supplied or conjectured, mathematical induction can verify it efficiently.

For example, prove

∑k=1nk3=n2(n+1)24.\sum_{k=1}^n k^3=\frac{n^2(n+1)^2}4.

At n=1n=1, both sides equal 11. Suppose the formula holds at a positive integer mm. Then

∑k=1m+1k3=m2(m+1)24+(m+1)3=(m+1)24{m2+4m+4}=(m+1)2(m+2)24.\begin{aligned} \sum_{k=1}^{m+1}k^3 &=\frac{m^2(m+1)^2}4+(m+1)^3\\ &=\frac{(m+1)^2}{4}\{m^2+4m+4\}\\ &=\frac{(m+1)^2(m+2)^2}{4}. \end{aligned}

This is the formula at m+1m+1, so the induction is complete. The base case and the use of the induction hypothesis are both explicit.

When expanding into power sums is unnecessary

Problem. Evaluate

∑k=1nk(k+1)(k+2)(k+3).\sum_{k=1}^n k(k+1)(k+2)(k+3).

Expanding gives a fourth-degree polynomial, so the formulas above could solve it. But the consecutive factors contain a shorter structure.

Let Pk=k(k+1)(k+2)(k+3)P_k=k(k+1)(k+2)(k+3). Multiplying by the next and previous factors gives

Pk(k+4)−Pk(k−1)=5Pk.P_k(k+4)-P_k(k-1)=5P_k.

Therefore

Pk=15{k(k+1)(k+2)(k+3)(k+4)−(k−1)k(k+1)(k+2)(k+3)}.P_k=\frac15\{k(k+1)(k+2)(k+3)(k+4)-(k-1)k(k+1)(k+2)(k+3)\}.

In the sum, the negative product for one index cancels the positive product for the previous index. Only the last positive term and the first negative term remain. The first negative term is zero because it contains k−1=0k-1=0 at k=1k=1. Hence

∑k=1nk(k+1)(k+2)(k+3)=n(n+1)(n+2)(n+3)(n+4)5.\boxed{\sum_{k=1}^n k(k+1)(k+2)(k+3)=\frac{n(n+1)(n+2)(n+3)(n+4)}5.}

This calculation does not require memorizing the fourth-power formula. More generally, consecutive products often have a simple finite-difference antiderivative; look for that structure before expanding.

How to check a power-sum answer

Test a small value such as n=1n=1 or 22. Then verify that the proposed expression F(n)F(n) has F(n)−F(n−1)=nrF(n)-F(n-1)=n^r and the correct starting value. These checks also explain why a correct formula holds for every integer nn, not just the first few.

Related: telescoping sums and consecutive products.

Related articles

About the author

Koki Saito

Physician and graduate of the University of Tokyo Faculty of Medicine. Drawing on his entrance-exam experience, he explains how to choose mathematical methods and construct complete solutions.

Full profile →

Have a question or spotted an error? Contact us.