$ \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. 
 A: EDIT: obsolete. The limit I was discussing was not the one intended by OP.

This diverges to infinity. Let $M \in \mathbb{R}_+$ and $I = \int_0^{\pi/2} \frac{\sin \, x}{x}dx$:
\begin{eqnarray}
\int_0^{\pi/2} \sum_{k=1}^n \left(\frac{\sin\, kx}{x} \right)^2 dx 
& = & \sum_{k=1}^n \int_0^{\pi/2} \left(\frac{\sin\, kx}{x} \right)^2 dx \; \;\mbox{because finite sum} \\
& = & \sum_{k=1}^n k^2 \int_0^{\pi/2} \left(\frac{\sin\, kx}{kx} \right)^2 dx \\
& = & \sum_{k=1}^n k \int_0^{k\pi/2} \left(\frac{\sin\, x}{x} \right)^2 dx \\
& \geq & \sum_{k=1}^n k I
\end{eqnarray}
So, with $k$ large enough, your integral of sum is superior to $M$
A: 
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*} $$
A: Let
$$ I_n(a)=\int_0^{\frac{\pi}{2}}\sum_{k=1}^n\left(\frac{\sin(akx)}{k}\right)^2dx. $$
Then $I_n(0)=0$ and
\begin{eqnarray}
I_n'(a)&=&\int_0^{\frac{\pi}{2}}\sum_{k=1}^n\frac{x\sin(2akx)}{k}dx\\
&=&\sum_{k=1}^n\frac{-ak\pi\cos(ak\pi)+\sin(akx)}{4a^2k^3}\\
&=&-\frac{d}{da}\sum_{k=1}^n\frac{\sin(ak\pi)}{4ak^3}
\end{eqnarray}
and hence
\begin{eqnarray}
\lim_{n\to\infty}I_n(1)&=&-\sum_{k=1}^n\frac{\sin(ak\pi)}{4ak^3}\bigg|_{0}^1\\
&=&\frac{\pi}{4}\sum_{k=1}^n\frac{1}{k^2}\\
&=&\frac{\pi^3}{24}.
\end{eqnarray}
