---
tags: calculus
---
# Apostol's Double Integral to Calculate $\zeta(2)$
2022-11-14
J. Colliander
> Notes for MATH200 Lecture 2022-11-14
> Notes for MATH253 Lecture 2022-11-25
These notes are available at: [bit.ly/basel-problem](https://bit.ly/basel-problem)

## 0. Background
The [Basel Problem](https://en.wikipedia.org/wiki/Basel_problem), first posed in the mid-17th century, asks for a closed form expression for the value of the sum of the square reciprocals
$$
\sum_{k=1}^\infty \frac{1}{k^2}.
$$
The problem remained open for almost a century. [Leonhard Euler](https://en.wikipedia.org/wiki/Leonhard_Euler) answered the question in 1734 and showed the sum converges to $\frac{\pi^2}{6}$. The Basel Problem and Euler's work inspired [Bernard Riemann](https://en.wikipedia.org/wiki/Bernhard_Riemann) to introduce the [Riemann zeta function](https://en.wikipedia.org/wiki/Riemann_zeta_function)
$$
\zeta(s) = \sum_{k=1}^\infty \frac{1}{k^s}
$$
and the celebrated [Riemann Hypothesis](https://en.wikipedia.org/wiki/Riemann_hypothesis). This video is an intriguing introduction to the Riemann Hypothesis.
<iframe width="560" height="315" src="https://www.youtube.com/embed/zlm1aajH6gY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
[Tom Apostol (1983)](https://fermatslibrary.com/s/a-proof-that-euler-missed) found an approach to calculating $\zeta(2)$ using multivariable calculus. Additional information about the Basel Problem is available in these [excellent slides by Brendan W. Sullivan](https://www.math.cmu.edu/~bwsulliv/basel-problem.pdf). These notes follow Apostol's argument.
## 1. A Double Integral and Geometric Series
The double integral
$$
I = \int_0^1 \int_0^1 \frac{1}{1-xy} dx dy
$$
can be recast using the [geometric series](https://en.wikipedia.org/wiki/Geometric_series) as
$$
I = \int_0^1 \int_0^1 \sum_{n=0}^\infty (xy)^n dx dy.
$$
Interchanging the sum and integrals, and carrying out the integrations term-by-term, reveals
$$
I = \sum_{n=0}^\infty \frac{1}{n+1} \frac{1}{n+1} = \sum_{k=1}^\infty \frac{1}{k^2}.
$$
Therefore, the answer to the Basel Problem is the volume under the surface $z = \frac{1}{1 -xy}$ above the unit square $Q= \{ (x,y): 0 < x <1, 0 <y <1\}.$
## 2. Inspecting the Integral
The integral over the unit square can be decomposed into integrals over the triangles above and below the diagonal $y=x$
$$I = \int_0^1 \int_0^y \frac{1}{1-xy} dx dy + \int_0^1 \int_0^x \frac{1}{1-xy} dy dx.
$$
Interchanging the symbols $x \leftrightarrow y$ and recognizing $xy = yx$ shows these two integrals are equal so
$$
I = 2 \int_0^1 \int_0^y \frac{1}{1-xy} dx dy.
$$
The integrand explodes to infinity as $(x,y)$ approaches $(1,1)$.
## 3. Change Variables
We change variables by writing
$$
x = \frac{1}{\sqrt{2}} (u - v); ~ y = \frac{1}{\sqrt{2}} (u + v),
$$
or, equivalently,
$$
u = \frac{1}{\sqrt{2}}(x + y); ~ v = {\frac{1}{\sqrt{2}}}(y-x).
$$
The Jacobian of this change of variables can be calculated
$$
\begin{vmatrix} {\frac{\partial{x}}{\partial{u}}} & {\frac{\partial{x}}{\partial{v}}} \\ {\frac{\partial{y}}{\partial{u}}} & {\frac{\partial{x}}{\partial{v}}} \end{vmatrix} = \begin{vmatrix} \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \end{vmatrix} = 1.
$$
This change of variables is a rotation by $\frac{\pi}{4}$ and places the hypoteneuse of the upper triangle along the $u$ axis where $v=0$.
After calculating $xy = \frac{1}{2}(u^2 - v^2)$, integrand is reexpressed as
$$
\frac{1}{1-xy} = \frac{2}{2 - u^2 + v^2},
$$
so
$$
I = 4 \int_0^{\frac{1}{\sqrt{2}}} \int_0^u \frac{1}{2-u^2 + v^2} dv du + 4 \int_{\frac{1}{\sqrt{2}}}^{\sqrt{2}} \int_0^{\sqrt{2} - u}\frac{1}{2-u^2 + v^2} dv du = I_1 + I_2.
$$
## 4. Evaluate Inner Integrals using Inverse Tangent
The change of variables allows us to use the integration formula
$$
\int_0^x \frac{dt}{a^2 + t^2} = \frac{1}{a} \tan^{-1}(\frac{x}{a}).
$$
The inner $v$-integral in $I_1$,
$$
\int_0^u \frac {1}{(\sqrt{2-u^2})^2 + v^2} dv = \frac{1}{\sqrt{2-u^2}} \tan^{-1}(\frac{u}{\sqrt{2-u^2}}).
$$
The inner $v$-integral in $I_2$,
$$
\int_0^{\sqrt{2} - u} \frac {1}{(\sqrt{2-u^2})^2 + v^2} dv = \frac{1}{\sqrt{2-u^2}} \tan^{-1}(\frac{\sqrt{2} - u}{\sqrt{2-u^2}}).
$$
It remains to calculate
$$
I = 4 \int_0^{\frac{1}{\sqrt{2}}} \tan^{-1}(\frac{u}{\sqrt{2-u^2}}) \frac{du}{\sqrt{2 - u^2}} + 4 \int_{\frac{1}{\sqrt{2}}}^{\sqrt{2}} \tan^{-1}(\frac{\sqrt{2} - u}{\sqrt{2-u^2}}) \frac{du}{\sqrt{2 - u^2}} = I_1 + I_2.
$$
## 5. Evaluate Outer Integrals by Trigonometric Substitution
### Evaluate $I_1$
Change variables by writing $u = \sqrt{2} \sin(\theta)$. The integration in $u$ across $[0, \frac{1}{\sqrt{2}}]$ corresponds to integration in $\theta$ across $[0, \frac{\pi}{6}]$ (since $\frac{1}{2} = \sin(\frac{\pi}{6})$). Calculating, we find $du = \sqrt{2} \cos{\theta} = \sqrt{2 - u^2} d\theta.$ It may be helpful to draw a right triangle with hypoteneuse of length $\sqrt{2}$, an adjacent side of length $\sqrt{2} \cos(\theta)$, and opposite side of length $\sqrt{2} \sin (\theta) = u$ to confirm that $\cos(\theta) = \sqrt{2 - u^2}.$ From the triangle,
$$
\tan(\theta) = \frac{u}{\sqrt{2 - u^2}},
$$
so,
$$
I_1 = 4 \int_0^{\frac{\pi}{6}} \theta ~d\theta = 2 ( \frac{\pi}{6})^2.
$$
### Evaluate $I_2$
Change variables by writing $u = \sqrt{2} \cos(2\theta)$. The integration in $u$ across $[\frac{1}{\sqrt{2}}, \sqrt{2}]$ correponds to integrating _backwards_ from $\frac{\pi}{6}$ to $0$. We calculate
$$
du = -2 \sqrt{2} \sin (2\theta) ~d\theta = -2 \sqrt{2} \sqrt{1 - \cos^2 (2\theta)}~ d\theta = -2 \sqrt{2 - u^2} ~ d\theta.
$$
This change of variable is inspired because
$$
\frac{\sqrt{2} - u}{\sqrt{2 - u^2}} = \frac{\sqrt{2}(1 - \cos (2\theta))}{\sqrt{2 - 2 \cos^2 (2\theta)}} = \frac{\sqrt{2}(1 - \cos (2\theta))}{\sqrt{2} \sqrt{(1 + \cos (2\theta))(1 - \cos (2\theta))}},
$$
and continuing the calculation using double angle formulae
$$
= \frac{\sqrt{1 - \cos (2 \theta)}}{\sqrt{1 + \cos (2\theta)}} = \sqrt{\frac{2 \sin^2 \theta}{2 \cos^2 \theta}} = \tan (\theta)!
$$
Therefore,
$$
I_2 = 4 \int_{\frac{\pi}{6}}^0 \theta (-2) ~d\theta = 8 \int_0^{\frac{\pi}{6}} \theta ~ d\theta = 4 (\frac{\pi}{6})^2.
$$
Combining, we find the answer to the Basel Problem by writing
$$
I = I_1 + I_2 = 2 (\frac{\pi}{6})^2 + 4 (\frac{\pi}{6})^2 = \frac{\pi^2}{6}.
$$
This argument establishes that
$$
\zeta(2) =\sum_{k=1}^\infty \frac{1}{k^2} = \frac{\pi^2}{6}.
$$