Blog/Research

The Basel Problem: How Euler Proved That 1/1² + 1/2² + 1/3² + ... = π²/6

A 90-year-old mystery, a 28-year-old genius, and the proof that launched modern analysis.

Introduction

In 1644, the Italian mathematician Pietro Mengoli posed a question that would haunt the greatest minds in Europe for nearly a century: what is the exact value of the sum 112+122+132+142+\frac{1}{1^2} + \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \cdots? The series clearly converges — each term shrinks rapidly — but to what? Mathematicians could compute partial sums to arbitrary precision, yet the exact closed form eluded everyone. The Bernoulli family, among the most prolific mathematical dynasties in history, tried and failed. Jakob Bernoulli himself publicly admitted defeat, writing that he would be grateful to anyone who could find the answer.

Ninety-one years later, in 1735, a 28-year-old Leonhard Euler announced the solution. The answer was not a ratio of integers, not an algebraic number, but something far stranger: π26\frac{\pi^2}{6}. The sum of reciprocal squares of the natural numbers — a purely arithmetic object built from integers alone — equals a constant defined by the geometry of the circle divided by six. This result shocked the mathematical world. It was the first deep, unexpected connection between discrete arithmetic and continuous geometry, and it launched an entire branch of mathematics that would ultimately lead to the Riemann zeta function and some of the deepest unsolved problems in number theory.

Mathematical proof written on a chalkboard with summation notation and pi
The Basel Problem — where the integers meet the circle, and arithmetic meets geometryPhoto on Unsplash

The Problem

The Basel Problem asks for the exact value of the infinite series:

n=11n2=112+122+132+142+152+\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{1}{1^2} + \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \frac{1}{5^2} + \cdots

Before we can talk about the exact value, we need to know this series converges. One way to see this is by comparison with a telescoping series. Notice that for n2n \geq 2:

1n2<1n(n1)=1n11n\frac{1}{n^2} < \frac{1}{n(n-1)} = \frac{1}{n-1} - \frac{1}{n}

So the partial sum satisfies:

n=1N1n2=1+n=2N1n2<1+n=2N(1n11n)=1+11N<2\sum_{n=1}^{N} \frac{1}{n^2} = 1 + \sum_{n=2}^{N} \frac{1}{n^2} < 1 + \sum_{n=2}^{N} \left( \frac{1}{n-1} - \frac{1}{n} \right) = 1 + 1 - \frac{1}{N} < 2

The partial sums are increasing and bounded above by 2, so the series converges. But to what? The first several partial sums tell a suggestive story:

1
S1=1.000000S_1 = 1.000000
2
S2=1.250000S_2 = 1.250000
3
S5=1.463611...S_5 = 1.463611...
4
S10=1.549768...S_{10} = 1.549768...
5
S100=1.634984...S_{100} = 1.634984...
6
S1000=1.643935...S_{1000} = 1.643935...
7
S=1.644934...S_{\infty} = 1.644934...

That limit, 1.6449340668...1.6449340668..., is suspiciously close to π26=1.6449340668...\frac{\pi^2}{6} = 1.6449340668.... But knowing the decimal expansion is not the same as proving the identity. Mathematicians in the early 18th century could compute these partial sums to many decimal places. They could even conjecture the answer. What they could not do was prove it. The gap between numerical evidence and rigorous proof is where the real mathematics lives.

Failed Attempts

The Basel Problem resisted solution for 91 years, and it is worth understanding why. This was not a problem that lacked attention. Some of the finest mathematical minds of the 17th and early 18th centuries worked on it.

Pietro Mengoli posed the problem in 1644 but could not solve it himself. Jakob Bernoulli, who made foundational contributions to probability theory and calculus, attempted the problem repeatedly and published his frustration. He proved that the sum was bounded between 32\frac{3}{2} and 22, but tightening these bounds proved extraordinarily difficult. His brother Johann Bernoulli, equally brilliant and famously competitive, also failed.

The difficulty was not computational but conceptual. The tools available — geometric series, comparison tests, telescoping sums — could establish convergence and approximate the value, but no known technique could produce an exact closed form. The problem required a fundamentally new idea: treating the sine function as an infinite polynomial and factoring it by its roots. This was the insight that only Euler had the audacity to try.

Historical context

The Basel Problem is named after Basel, Switzerland, the hometown of the Bernoulli family and also of Euler. It is fitting that the problem that defeated the Bernoullis was solved by their most famous student — Euler studied under Johann Bernoulli in Basel before moving to St. Petersburg.

Euler's Brilliant Insight — The sin(x)/x Product

Euler's proof begins with one of the most important functions in mathematics: sin(x)\sin(x). The Taylor series expansion of the sine function around zero is:

sin(x)=xx33!+x55!x77!+=k=0(1)kx2k+1(2k+1)!\sin(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots = \sum_{k=0}^{\infty} \frac{(-1)^k x^{2k+1}}{(2k+1)!}

If we divide both sides by xx, we obtain the function sin(x)x\frac{\sin(x)}{x}, sometimes called the sinc function:

sin(x)x=1x23!+x45!x67!+=1x26+x4120x65040+\frac{\sin(x)}{x} = 1 - \frac{x^2}{3!} + \frac{x^4}{5!} - \frac{x^6}{7!} + \cdots = 1 - \frac{x^2}{6} + \frac{x^4}{120} - \frac{x^6}{5040} + \cdots

Now comes the crucial observation. The function sin(x)x\frac{\sin(x)}{x} has a very specific set of zeros. Since sin(x)=0\sin(x) = 0 when x=nπx = n\pi for any nonzero integer nn, and dividing by xx removes the root at x=0x = 0, the function sin(x)x\frac{\sin(x)}{x} has zeros precisely at:

x=±π,  ±2π,  ±3π,  ±4π,  x = \pm \pi, \; \pm 2\pi, \; \pm 3\pi, \; \pm 4\pi, \; \ldots

Euler's key insight was an analogy with polynomials. If a polynomial p(x)p(x) of degree nn has roots r1,r2,,rnr_1, r_2, \ldots, r_n and satisfies p(0)=1p(0) = 1, then it factors as:

p(x)=(1xr1)(1xr2)(1xrn)p(x) = \left(1 - \frac{x}{r_1}\right)\left(1 - \frac{x}{r_2}\right) \cdots \left(1 - \frac{x}{r_n}\right)

Euler boldly extended this to the transcendental function sin(x)x\frac{\sin(x)}{x}, which is not a polynomial but an “infinite polynomial” with infinitely many roots. Since the roots come in pairs ±nπ\pm n\pi, pairing them gives factors of the form (1xnπ)(1+xnπ)=1x2n2π2\left(1 - \frac{x}{n\pi}\right)\left(1 + \frac{x}{n\pi}\right) = 1 - \frac{x^2}{n^2\pi^2}. Therefore:

sin(x)x=(1x2π2)(1x24π2)(1x29π2)(1x216π2)\frac{\sin(x)}{x} = \left(1 - \frac{x^2}{\pi^2}\right)\left(1 - \frac{x^2}{4\pi^2}\right)\left(1 - \frac{x^2}{9\pi^2}\right)\left(1 - \frac{x^2}{16\pi^2}\right) \cdots

In compact notation:

sin(x)x=n=1(1x2n2π2)\frac{\sin(x)}{x} = \prod_{n=1}^{\infty} \left(1 - \frac{x^2}{n^2 \pi^2}\right)

This is the infinite product representation of sin(x)x\frac{\sin(x)}{x}. Euler used it before it was rigorously justified. The rigorous foundation came later through Weierstrass's factorization theorem, which confirms that entire functions can be expressed as products over their zeros (with appropriate convergence factors). Euler's mathematical intuition was running decades ahead of the available theory, and he was right.

The leap of faith

Euler treated a transcendental function as if it were a polynomial with infinitely many roots. This was not rigorous by modern standards, and contemporaries questioned it. But the answer it produced was correct, and the approach opened doors that led to some of the deepest results in complex analysis.

Matching Coefficients

We now have two representations of the same function sin(x)x\frac{\sin(x)}{x}. Euler's strategy is to expand both and compare the coefficients of x2x^2.

The Taylor Series Form

From the Taylor series, we already have:

sin(x)x=1x26+x4120\frac{\sin(x)}{x} = 1 - \frac{x^2}{6} + \frac{x^4}{120} - \cdots

The coefficient of x2x^2 in this expansion is 16-\frac{1}{6}.

The Infinite Product Form

Now consider the product expansion:

n=1(1x2n2π2)=(1x2π2)(1x24π2)(1x29π2)\prod_{n=1}^{\infty} \left(1 - \frac{x^2}{n^2 \pi^2}\right) = \left(1 - \frac{x^2}{\pi^2}\right)\left(1 - \frac{x^2}{4\pi^2}\right)\left(1 - \frac{x^2}{9\pi^2}\right) \cdots

When we multiply this out, the constant term is clearly 11 (the product of all the 1s). The x2x^2 coefficient comes from choosing the x2n2π2-\frac{x^2}{n^2\pi^2} term from exactly one factor and the 11 from every other factor. Summing over all such choices:

coefficient of x2=1π214π219π2116π2\text{coefficient of } x^2 = -\frac{1}{\pi^2} - \frac{1}{4\pi^2} - \frac{1}{9\pi^2} - \frac{1}{16\pi^2} - \cdots

Factoring out 1π2-\frac{1}{\pi^2}:

coefficient of x2=1π2(112+122+132+142+)=1π2n=11n2\text{coefficient of } x^2 = -\frac{1}{\pi^2} \left( \frac{1}{1^2} + \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \cdots \right) = -\frac{1}{\pi^2} \sum_{n=1}^{\infty} \frac{1}{n^2}

Setting Them Equal

Since both expressions represent the same function, their x2x^2 coefficients must be equal:

1π2n=11n2=16-\frac{1}{\pi^2} \sum_{n=1}^{\infty} \frac{1}{n^2} = -\frac{1}{6}

Multiplying both sides by π2-\pi^2:

n=11n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}

And there it is. Ninety-one years of effort, resolved in a single stroke of algebraic comparison. The sum of the reciprocal squares of all positive integers is exactly π26\frac{\pi^2}{6}.

The algebraic beauty

The entire proof reduces to one idea: express the same function two different ways, then compare coefficients. The Taylor series gives you the coefficient from calculus. The infinite product gives you the coefficient from the zeros of sine. Setting them equal produces the identity. This technique of “matching coefficients” became one of Euler's most powerful tools.

Why This Was Revolutionary

It is hard to overstate the impact of Euler's result. Before 1735, mathematicians had no reason to expect that a sum built entirely from integers — 1,4,9,16,25,1, 4, 9, 16, 25, \ldots — would have anything to do with π\pi, a constant defined by the ratio of a circle's circumference to its diameter. The Basel Problem revealed a hidden bridge between arithmetic and geometry that no one had suspected.

Mathematical visualization showing the connection between pi and infinite series
Pi appears in the most unexpected places — the Basel Problem was the first proof that arithmetic sums encode geometric constantsPhoto on Unsplash

Euler did not stop at ζ(2)\zeta(2). By matching higher-order coefficients in the same product-series comparison, he computed the exact values of ζ(s)=n=11ns\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} for all positive even integers:

ζ(2)=π26,ζ(4)=π490,ζ(6)=π6945,ζ(8)=π89450\zeta(2) = \frac{\pi^2}{6}, \quad \zeta(4) = \frac{\pi^4}{90}, \quad \zeta(6) = \frac{\pi^6}{945}, \quad \zeta(8) = \frac{\pi^8}{9450}

The general pattern, later formalized using Bernoulli numbers B2kB_{2k}, is:

ζ(2k)=(1)k+1(2π)2kB2k2(2k)!\zeta(2k) = \frac{(-1)^{k+1} (2\pi)^{2k} B_{2k}}{2 \cdot (2k)!}

Every even zeta value is a rational multiple of a power of π\pi. This is a deep structural fact about the integers and their relationship to the circle.

But here is the mystery that remains: the odd zeta values — ζ(3),ζ(5),ζ(7),\zeta(3), \zeta(5), \zeta(7), \ldots — resist all similar characterization. In 1978, Roger Apery stunned the mathematical world by proving that ζ(3)\zeta(3) is irrational (it is now called Apery's constant, approximately 1.2020569...1.2020569...). But we still do not know whether ζ(3)\zeta(3) is related to π\pi in any natural way. We do not even know whether ζ(5)\zeta(5) is irrational. The even-odd asymmetry in the zeta function is one of the deepest unsolved puzzles in number theory.

Euler's work on the Basel Problem also laid the foundation for the Riemann zeta function, which Bernhard Riemann extended to the complex plane in 1859. Riemann's insight was that the function ζ(s)\zeta(s) could be analytically continued to all complex values of ss (except s=1s = 1), and that the distribution of prime numbers is intimately connected to the zeros of this function. The Riemann Hypothesis — that all nontrivial zeros of ζ(s)\zeta(s) lie on the line Re(s)=12\text{Re}(s) = \frac{1}{2} — remains the most important unsolved problem in mathematics. It is, in a very real sense, a direct descendant of Euler's Basel Problem. I wrote more about this connection in my post on unsolved conjectures in mathematics.

From Basel to Riemann

The line from the Basel Problem to the Riemann Hypothesis is direct: Euler computed specific values of the zeta function. Riemann extended it to the complex plane and connected it to prime numbers. The question of where this function vanishes became the central problem of analytic number theory. It all started with the sum of reciprocal squares.

A Modern Proof Sketch — Parseval's Theorem

Euler's proof, while correct, relied on the unproven assumption that transcendental functions can be factored like polynomials. Over the following centuries, mathematicians found numerous independent proofs of the Basel identity. One of the most elegant uses Fourier analysis — a completely different branch of mathematics that did not exist in Euler's time.

Consider the function f(x)=xf(x) = x on the interval [π,π][-\pi, \pi]. Its Fourier series expansion is:

f(x)=x=n=12(1)n+1nsin(nx)f(x) = x = \sum_{n=1}^{\infty} \frac{2(-1)^{n+1}}{n} \sin(nx)

The Fourier coefficients are an=0a_n = 0 (since ff is odd) and bn=2(1)n+1nb_n = \frac{2(-1)^{n+1}}{n}. Now we invoke Parseval's theorem, which states that for a function with Fourier coefficients ana_n and bnb_n:

1πππf(x)2dx=a022+n=1(an2+bn2)\frac{1}{\pi} \int_{-\pi}^{\pi} |f(x)|^2 \, dx = \frac{a_0^2}{2} + \sum_{n=1}^{\infty} \left( a_n^2 + b_n^2 \right)

Parseval's theorem is, at its core, a statement about energy conservation: the total energy of a signal equals the sum of energies of its frequency components. Let us compute each side for f(x)=xf(x) = x.

The Left Side

1πππx2dx=1π2π33=2π23\frac{1}{\pi} \int_{-\pi}^{\pi} x^2 \, dx = \frac{1}{\pi} \cdot \frac{2\pi^3}{3} = \frac{2\pi^2}{3}

The Right Side

Since a0=0a_0 = 0 and an=0a_n = 0 for all nn, and bn=2(1)n+1nb_n = \frac{2(-1)^{n+1}}{n}, we get:

n=1bn2=n=14n2=4n=11n2\sum_{n=1}^{\infty} b_n^2 = \sum_{n=1}^{\infty} \frac{4}{n^2} = 4 \sum_{n=1}^{\infty} \frac{1}{n^2}

Equating Both Sides

Parseval's theorem gives us:

2π23=4n=11n2\frac{2\pi^2}{3} = 4 \sum_{n=1}^{\infty} \frac{1}{n^2}

Dividing both sides by 4:

n=11n2=2π212=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{2\pi^2}{12} = \frac{\pi^2}{6}

The same answer, derived from a completely independent set of ideas. The fact that Euler's product-based argument and the Fourier-analytic approach converge on the same identity is a deep confirmation. The result is not an accident of one method. It is a structural truth about the relationship between integers and the circle that manifests through every lens we turn on it.

Two roads to the same summit

Euler's proof uses the zeros of the sine function. The Fourier proof uses the orthogonality of sines and cosines. Both arrive at the same identity. In mathematics, when two completely different approaches yield the same result, it is a strong signal that the result touches something fundamental.

Python Verification

One of the things I love about mathematics is that you can verify deep theoretical results with a few lines of code. Here is a Python script that computes the Basel sum numerically and compares it to π26\frac{\pi^2}{6}:

python
import math

# Compute partial sums of the Basel series: sum of 1/n^2

def basel_partial_sum(N):
    """Compute the partial sum of 1/n^2 for n = 1, 2, ..., N."""
    return sum(1.0 / n**2 for n in range(1, N + 1))

# The exact answer

exact = math.pi**2 / 6

# Show convergence at different partial sums

print("Basel Problem: sum of 1/n^2 = pi^2/6")
print(f"{'N':>12}  {'Partial Sum':>18}  {'pi^2/6':>18}  {'Error':>14}")
print("-" * 68)
for N in [1, 5, 10, 100, 1_000, 10_000, 100_000, 1_000_000]:
    s = basel_partial_sum(N)
    print(f"{N:>12,}  {s:>18.12f}  {exact:>18.12f}  {abs(s - exact):>14.2e}")

# Output:

#            N        Partial Sum            pi^2/6           Error

# --------------------------------------------------------------------

#            1    1.000000000000    1.644934066848    6.45e-01

#            5    1.463611111111    1.644934066848    1.81e-01

#           10    1.549767731166    1.644934066848    9.52e-02

#          100    1.634983900185    1.644934066848    9.95e-03

#        1,000    1.643934566682    1.644934066848    1.00e-03

#       10,000    1.644834071848    1.644934066848    1.00e-04

#      100,000    1.644924066898    1.644934066848    1.00e-05

#    1,000,000    1.644933066849    1.644934066848    1.00e-06


# The error decreases as ~1/N, confirming convergence

# For an exact verification, we can use the mpmath library:

try:
    from mpmath import mp, mpf, pi, nsum, inf
    mp.dps = 50  # 50 decimal places

    result = nsum(lambda n: 1 / n**2, [1, inf])
    target = pi**2 / 6
    print(f"\nHigh-precision verification (50 digits):")
    print(f"  sum 1/n^2 = {result}")
    print(f"  pi^2/6    = {target}")
    print(f"  Match: {str(result)[:50] == str(target)[:50]}")
except ImportError:
    print("\n(Install mpmath for arbitrary-precision verification)")

The convergence rate of the partial sums is O(1/N)O(1/N), which is relatively slow — you need a million terms to get six decimal places. This is because the error in truncating the series at NN is approximately N1x2dx=1N\int_N^{\infty} \frac{1}{x^2} \, dx = \frac{1}{N}. But the mathematical identity is exact. The partial sums converge to π26\frac{\pi^2}{6} not approximately but precisely, to every decimal place, forever.

Conclusion

I keep coming back to the Basel Problem because it captures something essential about mathematics: the most profound truths are often hidden in the simplest questions. The sum 1+14+19+116+1 + \frac{1}{4} + \frac{1}{9} + \frac{1}{16} + \cdots looks like it should have a boring answer. It is just adding up fractions with square denominators. There is no circle in sight, no geometry, no trigonometry. And yet the answer is π26\frac{\pi^2}{6}, a quantity that encodes the circumference-to-diameter ratio of every circle that has ever existed or ever will.

This is what drew me to mathematics in the first place. As someone who spends most of my time building AI systems and studying for medical school, I sometimes get asked why I care about 18th-century number theory. The answer is that results like the Basel Problem train a specific kind of thinking: the conviction that hidden structure exists and can be found. When I am debugging a machine learning pipeline or studying a biochemical pathway, I carry the same instinct — that beneath the surface complexity, there is an elegant organizing principle waiting to be uncovered.

Euler was 28 when he proved the Basel identity. He had decades of extraordinary work ahead of him. But this was the result that announced him to the world, that showed a young mathematician could see connections invisible to his predecessors. The sum of reciprocal squares is not just a formula. It is a proof that arithmetic and geometry are two languages describing the same underlying reality, and that the deepest mathematical surprises come not from exotic constructions but from asking the simplest questions and refusing to stop until you find the answer.

The lasting lesson

A sum built from integers. An answer built from the circle. The Basel Problem is a permanent reminder that mathematics is not a collection of separate subjects — it is one vast, interconnected structure, and the most beautiful results are the bridges between its parts.

Stay in the loop

Follow along as I explore the intersection of medicine, AI, and engineering.

Just honest writing, straight from me. Unsubscribe anytime.