Complex Analysis Solution to the Basel Problem ($\sum_{k=1}^\infty \frac{1}{k^2}$) [duplicate]
Most of us are aware of the famous "Basel Problem":
$$\sum_{k=1}^\infty \frac{1}{k^2} = \frac{\pi^2}{6}$$
I remember reading an elegant proof for this using complex numbers to help find the value of the sum. I tried finding it again to no avail. Does anyone know a complex number proof for the solution of the Basel Problem?
The most straightforward way I know is to consider the contour integral $$ \frac{1}{2\pi i}\oint\pi\cot(\pi z)\frac{1}{z^2}\mathrm{d}z\tag{1} $$ around circles whose radii are $\frac12$ off an integer.
The function $\pi\cot(\pi z)$ has residue $1$ at every integer. Thus the integral in $(1)$ equals the residue of $\pi\cot(\pi z)\dfrac{1}{z^2}$ at $z=0$ plus twice the sum in question (one for the positive integers and one for the negative integers).
The integral in $(1)$ tends to $\color{blue}{0}$ as the radius goes to $\infty$.
The Laurent expansion of $\pi\cot(\pi z)\dfrac{1}{z^2}$ at $z=0$ is $$ \frac{1}{z^3}-\frac{\pi^2}{3z}-\frac{\pi^4z}{45}-\frac{2\pi^6z^3}{945}-\dots\tag{2} $$ The only term that contributes to the residue at $z=0$ is the $\dfrac1z$ term. That is, the residue at $z=0$ of $(2)$ is $\color{green}{-\frac{\pi^2}{3}}$. Thus, the sum in question must be $\color{red}{\frac{\pi^2}{6}}$ (so that $\color{green}{-\frac{\pi^2}{3}}+2\cdot\color{red}{\frac{\pi^2}{6}}=\color{blue}{0}$).
All the proofs I know of are in Kalman's article. There is one that uses complex analysis (residues, to be concrete).
Observe that:
$\\ \displaystyle csc^2(\pi z)=\frac{1}{sin^2(\pi z)}=\frac{1}{4sin^2\left(\frac{\pi z}{2}\right)cos^2\left(\frac{\pi z}{2}\right)}=\frac{sin^2\left(\frac{\pi z}{2}\right)+cos^2\left(\frac{\pi z}{2}\right)}{4sin^2\left(\frac{\pi z}{2}\right)cos^2\left(\frac{\pi z}{2}\right)}=\frac{1}{4}\left(\frac{1}{cos^2\left(\frac{\pi z}{2}\right)}+\frac{1}{sin^2\left(\frac{\pi z}{2}\right)}\right)=\frac{1}{4}\left(sec^2\left(\frac{\pi z}{2}\right)+csc^2\left(\frac{\pi z}{2}\right)\right)= \frac{1}{4}\left(csc^2\left(\frac{\pi}{2}-\frac{\pi z}{2}\right)+csc^2\left(\frac{\pi z}{2}\right)\right)=\frac{1}{4}\left(csc^2\left(\frac{ (z-1)\pi}{2}\right)+csc^2\left(\frac{\pi z}{2}\right)\right) \\ \\$
We conclude:
\begin{equation} csc^2(\pi z)=\frac{1}{4}\left(csc^2\left(\frac{ (z-1)\pi}{2}\right)+csc^2\left(\frac{\pi z}{2}\right)\right) \tag{1} \end{equation}
Take z=1/4, we get:
\begin{equation} 2=\frac{1}{4}\left(csc^2\left(\frac{3\pi}{8}\right)+csc^2\left(\frac{\pi }{8}\right)\right) \tag{2} \end{equation}
Let (2) our induction base, such as induction hypothesis valid for suppose that an n
\begin{equation} 1=\frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}csc^2\frac{(2k+1)\pi}{2^{n+1}} \tag{3} \end{equation}
Applying (1) in (3) , we have: \begin{equation} 1=\frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}csc^2\frac{(2k+1)\pi}{2^{n+1}}=\frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}\frac{1}{4}\left(csc^2\left(\frac{ \left(\frac{(2k+1)}{2^{n+1}}-1\right)\pi}{2}\right)+csc^2\left(\frac{ \frac{(2k+1)\pi}{2^{n+1}}}{2}\right)\right) \end{equation}
\begin{equation} =\frac{2}{4^{n+1}}\sum_{k=0}^{2^{n-1}-1}\left(csc^2\left(\frac{(2k+1-2^{n+1})\pi}{2^{n+2}}\right)+csc^2\left(\frac{(2k+1)\pi}{2^{n+2}}\right)\right)= \end{equation}
\begin{equation} =\frac{2}{4^{n+1}}\sum_{k=0}^{2^{n-1}-1}csc^2\left(\frac{2^{n+1}-(2k+1))\pi}{2^{n+2}}\right)+\frac{2}{4^{n+1}}\sum_{k=0}^{2^{n-1}-1}csc^2\left(\frac{(2k+1)\pi}{2^{n+2}}\right) \end{equation}
\begin{equation} =\frac{2}{4^{n+1}}\sum_{k=0}^{2^{n}-1}csc^2\left(\frac{(2k+1)\pi}{2^{n+2}}\right) \end{equation}
Completing the proof by induction that equality below is true:
\begin{equation} 1=\frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}csc^2\frac{(2k+1)\pi}{2^{n+1}} \tag{4} \end{equation}
On the other hand, using that $\displaystyle csc^2x=cot^2x+1$, we get:
\begin{equation} 1=\frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}cot^2\frac{(2k+1)\pi}{2^{n+1}}+\frac{2^{n}}{4^n} \end{equation}
\begin{equation} \frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}cot^2\frac{(2k+1)\pi}{2^{n+1}}=1-\frac{1}{2^n} \tag{5} \end{equation}
Using that $\displaystyle senx\leq x \leq tanx \Rightarrow cotx\leq \frac{1}{x} \leq cscx \Rightarrow cot^2x\leq \frac{1}{x^2} \leq csc^2x$, we have:
\begin{equation} \frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}cot^2\frac{(2k+1)\pi}{2^{n+1}}\leq \frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}\frac{2^{2n+2}}{((2k+1)\pi)^2} \leq \frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}csc^2\frac{(2k+1)\pi}{2^{n+1}} \end{equation} \begin{equation} \frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}cot^2\frac{(2k+1)\pi}{2^{n+1}}\leq \sum_{k=0}^{2^{n-1}-1}\frac{8}{((2k+1)\pi)^2} \leq \frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1}csc^2\frac{(2k+1)\pi}{2^{n+1}} \tag{6} \end{equation}
Substituting ( 4) and (5 ) in (6 ) , we have:
\begin{equation} 1-\frac{1}{2^n}\leq \sum_{k=0}^{2^{n-1}-1}\frac{8}{((2k+1)\pi)^2} \leq 1 \end{equation} Taking limit to infinity in all parts of inequality , we have:
\begin{equation} \lim_{n\rightarrow \infty}\left(1-\frac{1}{2^n}\right)\leq \lim_{n\rightarrow \infty} \sum_{k=0}^{2^{n-1}-1}\frac{8}{((2k+1)\pi)^2} \leq \lim_{n\rightarrow \infty} 1 \end{equation}
Hence: \begin{equation} \sum_{k=1}^{\infty}\frac{1}{(2k+1)^2} =\frac{\pi^2}{8} \end{equation} Observe that:
\begin{equation*} \sum_{k=1}^{\infty}\frac{1}{4k^2}= \lim_{n\rightarrow \infty} \left(\frac{1}{4}+\frac{1}{4^2}+\frac{1}{4^3}+...+\frac{1}{4^n}\right)\sum_{k=1}^{\infty}\frac{1}{(2k+1)^2} =\lim_{n\rightarrow \infty}\left(\frac{1}{4}+\frac{1}{4^2}+\frac{1}{4^3}+...+\frac{1}{4^n}\right)\frac{\pi^2}{8} \end{equation*} \begin{equation} = \frac{1}{3}\frac{\pi^2}{8}\Rightarrow \sum_{k=1}^{\infty}\frac{1}{4k^2}=\frac{\pi^2}{24} \end{equation} It follows that:
\begin{equation} \sum_{k=1}^{\infty}\frac{1}{k^2}=\frac{\pi^2}{6} \end{equation}