Some while ago, I showed a slightly dicey proof of the Basel Problem identity, $\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac {\pi^2}{6}$, and invited readers to share other proofs with me.

My old friend Jean Reinaud stepped up to the mark with an exercise from his undergraduate textbook:

The French isn’t that difficult, but just in case:

Determine real numbers $\alpha$ and $\beta$ such that $\int_0^\pi \br{\alpha t + \beta t^2} \cos(nt) \d t = \frac{1}{n^2}$, for any integer $n>0$.

Hence deduce $\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac {\pi^2}{6}$

As usual, I suggest having a go at this yourself before reading on. Below here be spoilers.

### Setting up the integral

The first part isn’t too tricky: integrating by parts and noting that $\sin(n\pi) = \sin(0) = 0$ for integer $n$ means the integral evaluates to $\frac{(a + 2\pi b)\cos(\pi n) - a}{n^2}$.

We need the top to be 1, and we split it into two cases: $n$ even and $n$ odd (since $\cos(\pi n)$ takes on different values in those cases.)

In the odd case, $\cos(\pi n)=1$, so $a + 2\pi b - a = 1$, giving $b = \frac{1}{2\pi}$.

In the even case, $\cos(\pi n) = -1$, so $-a - 2\pi b - a = 1$. However, $2 \pi b = 1$, so $-2a -1 = 1$, so $a = -1$.

Our integral is $\int_0^\pi \br{\frac{t^2}{2\pi} - t}\cos(n t) \d t$.

### The tricky bit: the infinite sum

So, to get our result, presumably we just need to sum all of those integrals from 1 to $\infty$, and boom ((Avoiding surprise factorial))! Out should pop our result.

The brackety bit doesn’t have anything to do with $n$, so we can write our summed integral as:

$\int_0^\pi \br{\frac{t^2}{2\pi} - t}\sum_{n=1}^\infty \cos(n t) \d t$.

Evaluating that sum, we hit a problem: it doesn’t converge for any value of $t$. For example, for $t=\pi$, $\cos(nt)$ oscillates between $-1$ and $1$ - and that sum is undefined. Even worse, for $t=0$, $\cos(nt)$ is always 1, so we end up with a sum that goes to infinity. It’s a disaster!

### But.

We can engage in a bit of jiggery-pokery with the partial sums, and show that they converge to the right thing.

Let’s start with $\sum_{n=0}^N \cos(nt)$. Depending on how interested you are, you can:

• a) Express each cosine as $\frac{e^{int} + e^{-int}}{2}$, add up the resulting geometric series and play about until you get the result;
• b) Look it up on Wolfram Alpha; or
• c) Look it up on Wikipedia.

All three, thankfully, give the same result: $\sum_{n=0}^N \cos(nt) = -\frac{1}{2} + \frac{\sin\br{\br{N+\frac{1}{2}}t}}{2\sin\br{\frac{t}{2}}}$.

Well, that’s a mess. However, it does reduce a pretty substantial sum to something that only depends on $N$ and $t$.

### Evaluating that mess

But how to evaluate that, combined with the quadratic $t$ factor? We’re after:

$\int_0^\pi \br{t - \frac{t^2}{2\pi}} \left[ -\frac{1}{2} + \frac{\sin\br{\br{N+\frac{1}{2}}t}}{2\sin\br{\frac{t}{2}}}\right] \d t$

Let’s split that hairy square bracket into two parts: the $-\frac {1}{2}$ bit will be easy to integrate, but $\int_0^\pi \br{t - \frac{t^2}{2\pi}} \left[ \frac{\sin\br{\br{N+\frac{1}{2}}t}}{2\sin\br{\frac{t}{2}}}\right] \d t$… less so. So much less so, I suggest calling it $I_N$.

Jean’s textbook gives us a hint: $\cot(t) < \frac{1}{t} < \cosec\br{t}$ over the domain we care about. In particular, $\left[ \frac{\sin\br{\br{N+\frac{1}{2}}t}}{2\sin\br{\frac{t}{2}}}\right] > \left[ \frac{\sin\br{\br{N+\frac{1}{2}}t}}{t}\right]$

That gives us a lower bound for $I_N$:

$I_N = \int_0^\pi \br{t - \frac{t^2}{2\pi}} \left[ \frac{\sin\br{\br{N+\frac{1}{2}}t}}{2\sin\br{\frac{t}{2}}}\right] \d t > \int_0^\pi \br{t - \frac{t^2}{2\pi}} \left[ \frac{\sin\br{\br{N+\frac{1}{2}}t}}{t}\right] \d t$

Pushing the $t$ in the denominator back into the quadratic factor, we get:

$I_N > \int_0^\pi \br{1 - \frac{t}{2\pi}} \sin\br{\br{N+\frac{1}{2}}t} \d t.$

Stick it in the parts formula, turn the crank, note that $\sin(N\pi)=0$ for integer $N$ and out pops $I_N > \frac{-2\cos(N\pi) + 2(1+2N)\pi}{\br{1+2N}^2\pi}$.

This is good: the lower bound goes to zero as $N$ gets large.

Great. However, that’s just a lower bound. What about an upper bound?

### Can we express it another way?

Of course we can.

Let’s come back to here:

$\frac{\sin\br{\br{N+\frac{1}{2}}t}}{2\sin\br{\frac{t}{2}}}$

… and expand the sine in the numerator. We get $\sin\br{\br{N+\frac{1}{2}}t} = \sin(Nt)\cos\br{\frac{1}{2}t} + \cos(Nt)\sin\br{\frac{1}{2}t}$.

Of course, there’s a $\sin\br{\frac{1}{2}t}$ in the denominator as well, so we can simplify to get $\sin\br{Nt}\cot\br{\frac{1}{2}t} + \cos(Nt)$. Suddenly the future is brighter.

… at least momentarily. $I_N = \int_0^\pi \br{t - \frac{t^2}{2\pi}} \br{\sin\br{Nt}\cot\br{\frac{1}{2}t} + \cos(Nt)} \d t$… is not Wolfram-friendly. However, Jean’s textbook comes to the rescue again: we know that $\cot\br{\frac{1}{2}t} < \frac{2}{t}$.

So, $I_N < \int_0^\pi \br{t - \frac{t^2}{2\pi}} \br{\frac{2\sin\br{Nt}}{t} + \cos(Nt)} \d t$. If I’ve done my sums right, that’s $\frac{1 - 2N + N\cos(N\pi)}{N^2}$ - which gives us an upper bound that goes to 0 as $N$ gets large.

So: $I_N$ is no bigger than an upper bound that goes to 0 in the limit, and no smaller than a lower bound that also goes to zero in the limit. By the squeeze theorem, as $N$ gets large, $I_N$ goes to 0.

Phew.

### Back to the integral

$\int_0^\pi \br{t - \frac{t^2}{2\pi}} \left[ -\frac{1}{2} + \frac{\sin\br{\br{N+\frac{1}{2}}t}}{2\sin\br{\frac{t}{2}}}\right] \d t$

Everything after the $-\frac{1}{2} +$ can be ignored - we just proved that bit of the integral goes to 0 in the limit.

Meanwhile, $-\frac{1}{2} \int_0^\pi \br{t - \frac{t^2}{2\pi}} \d t = \frac{\pi^2}{6}$, as required $\blacksquare$.

* If you’ve enjoyed this post, and want to do something kind: please sign up to be an organ donor. Without someone like you saying “I want to help someone live after I die,” Jean would not be with us today. I’m on the register - I’d be delighted if you joined me.