<s>[INST] Compute $\lim_{n\to\infty} \left(\int_0^{\pi} \frac{\sin^2 n x}{\sin x} \ dx-\sum_{k=1}^n \frac{1}{k}\right)$ Compute the limit 
$$\lim_{n\to\infty} \left(\int_0^{\pi} \frac{\sin^2 n x}{\sin x} \ dx-\sum_{k=1}^n \frac{1}{k}\right)$$
 [/INST] Let's suppose that $\ \displaystyle f(n):=\int_0^{\pi} \frac{\sin^2 n x}{\sin x} \ dx\ $ then :
\begin{align}
f(n+1)-f(n)&=\int_0^{\pi} \frac{\sin^2((n+1) x)-\sin^2(n x)}{\sin x} \ dx\\
&=\int_0^{\pi} \frac{\cos(2n x)-\cos(2(n+1) x)}{2\sin x} \ dx\\
&=\int_0^{\pi} \frac{\cos(2n x)(1-\cos(2x))+\sin(2nx)\sin(2x)}{2\sin x}dx\\ &=\int_0^{\pi} \frac{\cos(2n x)2\sin(x)^2)+\sin(2nx)2\sin(x)\cos(x)}{2\sin x} dx\\
&=\int_0^{\pi} \cos(2n x)\sin(x)+\sin(2nx)\cos(x)\;dx\\
&=\int_0^{\pi} \sin((2n+1) x)\;dx\\
&=\frac 2{2n+1} \\
\end{align}
So that your limit (as $\ (n+1)\to +\infty$) is the series :
$$f(0)+\sum_{n=0}^\infty \left(\frac 2{2n+1}-\frac 1{n+1}\right)=2\sum_{n=0}^\infty \left(\frac 1{2n+1}-\frac 1{2n+2}\right)=2\,\log(1+1)=\log(4)$$ 
(using the expansion of $\;\log(1+x)\,$ at $\,x=1$)
</s>