$ \lim_{n \to \infty} \int_0^{\frac{\pi}{2}} \sum_{k=1}^{n} \left( \frac {\sin kx}{k} \right)^2 \, \mathrm{d}x $ Here is a problem in calculus shared by a friend. Compute $$ \lim_{n \to \infty} \displaystyle\int_{0}^{\frac{\pi}{2}} \displaystyle\sum_{k=1}^{n} \left( \frac {\sin kx}{k} \right)^2 \, \mathrm{d}x. $$ It is not trivial to find the partial sum. Can we pull the limit inside to get $$ \displaystyle\int_{0}^{\frac{\pi}{2}} \displaystyle\sum_{k=1}^{\infty} \left( \frac {\sin kx}{k} \right)^2 \, \mathrm{d}x? $$Still, this is hard. 


Lemma: $ \displaystyle\int_{0}^{\frac{\pi}{2}} \sin^2 kx \, \mathrm{d}x = \frac {\pi}{4} $, for any integer $k$. 
Proof. First note that $ \sin^2 (kx) = \frac {1 - \cos (2kx)}{2} $, so our integral is $$ \begin {align*} \frac {1}{2} \cdot \displaystyle\int_{0}^{\frac {\pi}{2}} \left( 1 - \cos (2kx) \right) \, \mathrm{d}x &= \frac {1}{2} \cdot \left[ x - \frac {\sin (2kx)}{2k} \right]_{0}^{\frac {\pi}{2}} \\&= \frac {1}{2} \cdot \left( \frac {\pi}{2} - \frac {\sin \left( \pi k x \right)}{2k} \right) \\&= \frac {1}{2} \cdot \left( \frac {\pi}{2} - 0 \right) \\&= \frac {\pi}{4}, \end {align*} $$as desired. $\Box$

$$ \begin {align*} \displaystyle\int_{0}^{\frac{\pi}{2}} \displaystyle\sum_{k=1}^{n} \left( \frac {\sin kx}{k} \right)^2 \, \mathrm{d}x &= \displaystyle\sum_{k=1}^{n} \displaystyle\int_{0}^{\frac{\pi}{2}} \left( \frac {\sin kx}{k} \right)^2 \, \mathrm{d}x \\&= \displaystyle\sum_{k=1}^{n} \left( \frac {1}{k^2} \cdot \displaystyle\int_{0}^{\frac{\pi}{2}} \sin^2 kx \, \mathrm{d}x \right) \\&= \frac {\pi}{4} \cdot \displaystyle\sum_{k=1}^{n} \frac {1}{k^2}. \end {align*} $$Taking the limit, our answer is $$ \begin {align*} \frac {\pi}{4} \cdot \lim_{n \to \infty} \displaystyle\sum_{k=1}^{n} \frac {1}{k^2} &= \frac {\pi}{4} \cdot \displaystyle\sum_{k=1}^{\infty} \frac {1}{k^2} \\&= \dfrac {\pi}{4} \cdot \dfrac {\pi^2}{6} \\&= \boxed {\dfrac {\pi^3}{24}}. \end {align*} $$
