In short

Beyond the sum of the first n natural numbers (\frac{n(n+1)}{2}), there are closed-form formulas for sums of higher powers:

1^2 + 2^2 + \dots + n^2 = \frac{n(n+1)(2n+1)}{6}
1^3 + 2^3 + \dots + n^3 = \left[\frac{n(n+1)}{2}\right]^2

The sum of cubes is always the square of the sum of the first n natural numbers — a surprising and beautiful identity. The method of differences provides a systematic way to derive all these formulas.

Stack 10 cannonballs in a square pyramid. The bottom layer is a 4 \times 4 square (16 balls), the next is 3 \times 3 (9 balls), then 2 \times 2 (4 balls), and a single ball on top. The total is 1 + 4 + 9 + 16 = 1^2 + 2^2 + 3^2 + 4^2 = 30 cannonballs. An ammunition depot stores these pyramids, and the quartermaster needs to know how many cannonballs sit in a pyramid with n layers without counting them one by one.

The sum 1^2 + 2^2 + 3^2 + \dots + n^2 is a special series — a summation where the terms follow a power pattern rather than an arithmetic or geometric one. You already know the formula for \sum k = \frac{n(n+1)}{2} from arithmetic progressions. This article derives the formulas for \sum k^2 and \sum k^3, introduces the method of differences that produces all such formulas, and reveals a striking connection: the sum of cubes is always a perfect square.

Square pyramid of cannonballs with 4 layersA schematic side view of a square pyramid. The bottom layer shows a row of 4 circles representing the 4 by 4 base of 16 balls. Above it, 3 circles for the 3 by 3 layer of 9 balls. Then 2 circles for the 2 by 2 layer of 4 balls. A single circle on top. Labels show each layer's count as a perfect square. 1² = 1 2² = 4 3² = 9 4² = 16 Total = 1 + 4 + 9 + 16 = 30
A $4$-layer square pyramid. Each layer has $k^2$ cannonballs. The total count $1^2 + 2^2 + 3^2 + 4^2 = 30$ is the sum of the first $4$ perfect squares. The formula $\frac{4 \times 5 \times 9}{6} = 30$ gives the same answer instantly.

Sum of squares: \sum_{k=1}^{n} k^2

Derivation by the method of differences

The method of differences uses a telescoping identity. Consider the cube (k+1)^3 - k^3. Expand:

(k+1)^3 - k^3 = k^3 + 3k^2 + 3k + 1 - k^3 = 3k^2 + 3k + 1

Now sum both sides from k = 1 to k = n:

\sum_{k=1}^{n} [(k+1)^3 - k^3] = \sum_{k=1}^{n} (3k^2 + 3k + 1)

The left side telescopes — most terms cancel:

(2^3 - 1^3) + (3^3 - 2^3) + (4^3 - 3^3) + \dots + ((n+1)^3 - n^3) = (n+1)^3 - 1

The right side separates:

3\sum_{k=1}^{n} k^2 + 3\sum_{k=1}^{n} k + \sum_{k=1}^{n} 1 = 3\sum k^2 + 3 \cdot \frac{n(n+1)}{2} + n

Setting the two sides equal:

(n+1)^3 - 1 = 3\sum k^2 + \frac{3n(n+1)}{2} + n

Expand (n+1)^3 - 1 = n^3 + 3n^2 + 3n + 1 - 1 = n^3 + 3n^2 + 3n. So:

n^3 + 3n^2 + 3n = 3\sum k^2 + \frac{3n(n+1)}{2} + n

Isolate \sum k^2:

3\sum k^2 = n^3 + 3n^2 + 3n - \frac{3n(n+1)}{2} - n = n^3 + 3n^2 + 2n - \frac{3n^2 + 3n}{2}
= \frac{2n^3 + 6n^2 + 4n - 3n^2 - 3n}{2} = \frac{2n^3 + 3n^2 + n}{2} = \frac{n(2n^2 + 3n + 1)}{2} = \frac{n(2n+1)(n+1)}{2}

Divide by 3:

\sum_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6}
Verification table for the sum of squares formulaA table with columns for n, the cumulative sum of squares, and the formula value. Five rows from n equals 1 to 5 all show matching values: 1, 5, 14, 30, 55. n 1² + 2² + ... + n² n(n+1)(2n+1)/6 1 1 1·2·3/6 = 1 2 1 + 4 = 5 2·3·5/6 = 5 3 5 + 9 = 14 3·4·7/6 = 14 4 14 + 16 = 30 4·5·9/6 = 30 5 30 + 25 = 55 5·6·11/6 = 55 Every row matches — the formula works for n = 1 through 5, and induction proves it for all n.
A numerical check for $n = 1$ through $5$. The cumulative sums on the left match the formula on the right. The cannonball pyramid with $4$ layers has $30$ balls: $\frac{4 \times 5 \times 9}{6} = 30$.

You can also verify this formula by mathematical induction. The base case n = 1 gives \frac{1 \cdot 2 \cdot 3}{6} = 1, matching 1^2 = 1. For the inductive step, assume the formula holds for k and add (k+1)^2:

\frac{k(k+1)(2k+1)}{6} + (k+1)^2 = \frac{(k+1)[k(2k+1) + 6(k+1)]}{6} = \frac{(k+1)(2k^2 + 7k + 6)}{6} = \frac{(k+1)(k+2)(2k+3)}{6}

That is the formula with n = k + 1.

Sum of cubes: \sum_{k=1}^{n} k^3

Derivation by the method of differences

Use the same telescoping approach, but start one power higher. Consider (k+1)^4 - k^4:

(k+1)^4 - k^4 = 4k^3 + 6k^2 + 4k + 1

Sum from k = 1 to n. The left side telescopes to (n+1)^4 - 1:

(n+1)^4 - 1 = 4\sum k^3 + 6\sum k^2 + 4\sum k + n

You already know \sum k = \frac{n(n+1)}{2} and \sum k^2 = \frac{n(n+1)(2n+1)}{6}. Expand (n+1)^4 - 1 = n^4 + 4n^3 + 6n^2 + 4n. Substitute:

n^4 + 4n^3 + 6n^2 + 4n = 4\sum k^3 + 6 \cdot \frac{n(n+1)(2n+1)}{6} + 4 \cdot \frac{n(n+1)}{2} + n
= 4\sum k^3 + n(n+1)(2n+1) + 2n(n+1) + n

Expand the right side (excluding 4\sum k^3):

n(n+1)(2n+1) + 2n(n+1) + n = n[(n+1)(2n+1) + 2(n+1) + 1]
= n[(2n^2 + 3n + 1) + (2n + 2) + 1] = n[2n^2 + 5n + 4] = n(2n^2 + 5n + 4)

So:

4\sum k^3 = n^4 + 4n^3 + 6n^2 + 4n - n(2n^2 + 5n + 4)
= n^4 + 4n^3 + 6n^2 + 4n - 2n^3 - 5n^2 - 4n = n^4 + 2n^3 + n^2 = n^2(n+1)^2

Divide by 4:

\sum_{k=1}^{n} k^3 = \frac{n^2(n+1)^2}{4} = \left[\frac{n(n+1)}{2}\right]^2

This is a remarkable result: the sum of the first n cubes equals the square of the sum of the first n natural numbers. In other words:

1^3 + 2^3 + 3^3 + \dots + n^3 = (1 + 2 + 3 + \dots + n)^2
Visual identity: sum of cubes equals the square of the sumOn the left, four cubes of side 1, 2, 3, and 4 are stacked showing volumes 1, 8, 27, and 64. On the right, a large square with side length 1 plus 2 plus 3 plus 4 equals 10, area 100. Both sides equal 100. 1³=1 2³=8 3³=27 4³=64 1+8+27+64 = 100 = 10² = 100 (1+2+3+4)² = 10²
For $n = 4$: the sum of cubes $1 + 8 + 27 + 64 = 100$ equals $(1 + 2 + 3 + 4)^2 = 10^2 = 100$. The sum of cubes is always a perfect square — the square of the triangular number $\frac{n(n+1)}{2}$.

Check a few values: for n = 3, 1^3 + 2^3 + 3^3 = 1 + 8 + 27 = 36 = 6^2 = (1+2+3)^2. For n = 5, 1^3 + 2^3 + 3^3 + 4^3 + 5^3 = 225 = 15^2 = (1+2+3+4+5)^2. The identity holds every time.

The method of differences — the general machine

The derivations above used the same strategy: take a power (k+1)^{p+1} - k^{p+1}, expand, sum, and telescope. This is the method of differences, and it works for any power.

The recipe for \sum k^p:

  1. Expand (k+1)^{p+1} - k^{p+1} using the binomial theorem.
  2. Sum from k = 1 to n; the left side telescopes to (n+1)^{p+1} - 1.
  3. The right side involves \sum k^p, \sum k^{p-1}, ..., \sum k, \sum 1 — all of which are known from earlier steps.
  4. Isolate \sum k^p.

Each formula builds on the ones before it. The sum of first powers gives you the sum of squares, which gives you the sum of cubes, which gives you the sum of fourth powers, and so on. The pattern extends indefinitely, though the formulas grow longer with each step.

Chain of formulas built by the method of differencesFour boxes in a horizontal chain connected by arrows. The first box shows the sum of k, the second shows the sum of k squared, the third shows the sum of k cubed, and the fourth has an ellipsis for higher powers. Each arrow is labelled telescope with one higher power. Σk = n(n+1)/2 Σk² = n(n+1)(2n+1)/6 Σk³ = [n(n+1)/2]² ··· use (k+1)³ − k³ use (k+1)⁴ − k⁴ use (k+1)⁵ − k⁵ Each formula uses all the previous ones — a chain of telescoping identities.
The method of differences builds each sum-of-powers formula on top of the previous ones. To find $\sum k^2$, you telescope $(k+1)^3 - k^3$ and use $\sum k$. To find $\sum k^3$, you telescope $(k+1)^4 - k^4$ and use both $\sum k$ and $\sum k^2$.

Sum of fourth powers (a taste)

Telescope (k+1)^5 - k^5 = 5k^4 + 10k^3 + 10k^2 + 5k + 1. Sum from 1 to n:

(n+1)^5 - 1 = 5\sum k^4 + 10\sum k^3 + 10\sum k^2 + 5\sum k + n

Using the known formulas and solving for \sum k^4:

\sum_{k=1}^{n} k^4 = \frac{n(n+1)(2n+1)(3n^2+3n-1)}{30}

The formulas get more complex, but the method stays the same.

Worked examples

Example 1: Find the value of $1^2 + 2^2 + 3^2 + \dots + 20^2$

Step 1. Identify the formula.

This is \sum_{k=1}^{20} k^2, so use the sum-of-squares formula with n = 20.

Why: direct recognition — the terms are consecutive perfect squares starting from 1.

Step 2. Plug into the formula.

\sum_{k=1}^{20} k^2 = \frac{20 \times 21 \times 41}{6}

Why: n = 20, n + 1 = 21, 2n + 1 = 41.

Step 3. Compute.

= \frac{20 \times 21 \times 41}{6} = \frac{17220}{6} = 2870

Why: 20 \times 21 = 420, 420 \times 41 = 17220, 17220 \div 6 = 2870.

Step 4. Quick check with a smaller case.

For n = 5: \frac{5 \times 6 \times 11}{6} = 55. And 1 + 4 + 9 + 16 + 25 = 55. The formula checks out.

Why: verifying the formula on a case small enough to compute by hand catches any formula-recall errors.

Result: 1^2 + 2^2 + 3^2 + \dots + 20^2 = 2870.

Bar chart of k squared for k from 1 to 20A bar chart with 20 bars. The k-th bar has height proportional to k squared. The bars grow rapidly: bar 1 is tiny while bar 20 is tall. The total area of all bars represents the sum 2870. Bar 20 is highlighted. k 1 5 10 15 20 400 Total = 2870
The $20$ terms $1^2, 2^2, \dots, 20^2$ displayed as a bar chart. The bars grow quadratically. The red bar at $k = 20$ contributes $400$ — the single largest term — and the total of all bars is $2870$.

The bar chart shows why the sum grows so fast: the later terms are much larger than the earlier ones. The 20-th term (400) is 400 times the first term (1), and it alone accounts for about 14\% of the total.

Example 2: Show that $1^3 + 2^3 + 3^3 + \dots + 10^3 = (1 + 2 + 3 + \dots + 10)^2$, and find the value.

Step 1. Compute the sum of the first 10 natural numbers.

1 + 2 + 3 + \dots + 10 = \frac{10 \times 11}{2} = 55

Why: this is the base quantity whose square should equal the sum of cubes.

Step 2. Compute the sum of cubes using the formula.

\sum_{k=1}^{10} k^3 = \left[\frac{10 \times 11}{2}\right]^2 = 55^2 = 3025

Why: the sum-of-cubes formula says \sum k^3 = (\sum k)^2, so you just square the sum of natural numbers.

Step 3. Verify by partial computation.

1^3 + 2^3 + 3^3 + 4^3 + 5^3 = 1 + 8 + 27 + 64 + 125 = 225 = 15^2 = (1+2+3+4+5)^2. The pattern holds for n = 5, building confidence for n = 10.

Why: checking an intermediate case is faster than computing all 10 cubes and still validates the formula.

Step 4. State the result.

1^3 + 2^3 + \dots + 10^3 = 3025 = 55^2 = (1 + 2 + \dots + 10)^2. The identity is confirmed.

Why: the final statement exhibits both the numerical value and the structural identity.

Result: 1^3 + 2^3 + 3^3 + \dots + 10^3 = 3025 = 55^2.

The sum of cubes equals the square of the triangular numberA diagram showing the equation. On the left, a column of values: 1 cubed equals 1, 2 cubed equals 8, up to 10 cubed equals 1000, with a total of 3025. On the right, a large square labelled 55 squared equals 3025. An equals sign connects them. Sum of cubes 1³ = 1 2³ = 8 3³ = 27 9³ = 729 10³ = 1000 Total = 3025 = 55² = 3025 (1+2+...+10)² = 55² The sum of cubes is always a perfect square.
The sum $1^3 + 2^3 + \dots + 10^3 = 3025$ equals $55^2$, the square of the $10$-th triangular number. This is a specific instance of the general identity $\sum k^3 = (\sum k)^2$.

The identity \sum k^3 = (\sum k)^2 is one of those results that feels almost too clean to be true. The sum of cubes, a complicated-sounding quantity, collapses into the square of a simple sum. The method-of-differences derivation shows exactly why.

Common confusions

Going deeper

If you came here to learn the formulas for \sum k^2 and \sum k^3, see their derivations, and use the method of differences, you have everything you need. The rest of this section is for readers who want to see the broader pattern and a visual proof of the sum-of-cubes identity.

A visual proof that \sum k^3 = (\sum k)^2

There is a beautiful geometric proof. Arrange n^2 unit squares into an n-wide L-shaped border (called a gnomon) around the previous square. The k-th gnomon has 2k - 1 unit squares arranged in an L-shape around a (k-1) \times (k-1) square. But if each unit square in the k-th gnomon is replaced by a k \times k square, the gnomon's area becomes k^2 \times (2k - 1) = 2k^3 - k^2.

A more direct approach: tile a square of side 1 + 2 + 3 + \dots + n = T_n as follows. Place a 1 \times 1 square in one corner. Around it, place an L-shaped gnomon of width 2 (area 2 \cdot 1 \cdot 2 + 2^2 = 8 = 2^3). Around that, an L-shaped gnomon of width 3 (area 3^3). Each k-th gnomon has area k^3, and they fit together to fill the T_n \times T_n square exactly. So \sum k^3 = T_n^2. This tiling proof, attributed to various mathematicians across centuries, is one of the most elegant "proofs without words" in mathematics.

Faulhaber's formulas

The method of differences produces a formula for \sum k^p for every positive integer p. These are called Faulhaber's formulas (after a 17th-century mathematician who computed them up to p = 17). A remarkable pattern: when p is odd, \sum k^p can always be expressed as a polynomial in T_n = \frac{n(n+1)}{2}. For p = 1: \sum k = T_n. For p = 3: \sum k^3 = T_n^2. For p = 5: \sum k^5 = \frac{T_n^2(4T_n - 1)}{3}.

The deeper reason these formulas exist connects to Bernoulli numbers, a sequence of rational numbers that appear throughout number theory and analysis. The general formula involves Bernoulli numbers in its coefficients, but working out the details requires tools from combinatorics and generating functions that go beyond the scope of this article.

Connection to integration

Just as \sum k \approx \int_0^n x \, dx = \frac{n^2}{2}, you get:

\sum_{k=1}^{n} k^2 \approx \int_0^n x^2 \, dx = \frac{n^3}{3}, \qquad \sum_{k=1}^{n} k^3 \approx \int_0^n x^3 \, dx = \frac{n^4}{4}

The leading terms of the exact formulas are \frac{n^3}{3} (for \sum k^2) and \frac{n^4}{4} (for \sum k^3), matching the integrals. The remaining lower-order terms are correction factors that account for the discrete "staircase" nature of summation versus the smooth nature of integration. This connection is the starting point for the Euler-Maclaurin summation formula, which makes the relationship between sums and integrals precise.

Interactive: cumulative sum of cubes as n growsA graph showing the sum of cubes formula. A draggable point moves along a curve of the cumulative sum. The readout shows the current n and the sum of cubes value, along with the triangular number whose square it equals. n Σk³ 0 3 6 9 12 drag to change n
Drag the point to see how the sum of cubes $\sum_{k=1}^{n} k^3$ grows with $n$. The readout also shows the triangular number $\sum k$ whose square gives the same value — confirming the identity $\sum k^3 = (\sum k)^2$ at every step.

Where this leads next