<s>[INST] Limit of an integral (SEEMOUS 2014 problem 4) Please show me how to solve this problem. I tried to make the substitution $x/n=y$ but I don't know how to go further.

(a) Prove that $$\lim_{n\to\infty}n\int_0^n\frac{\arctan\frac{x}{n}}{x(x^2+1)}\,dx=\frac{\pi}{2}$$
(b) Find the limit $$\lim_{n\to\infty}n\left(n\int_0^n\frac{\arctan\frac{x}{n}}{x(x^2+1)}\,dx-\frac{\pi}{2}\right)$$

 [/INST] About the first integral, we have
$$ \int_{n}^{+\infty}\frac{dx}{1+x^2}=O\left(\frac{1}{n}\right) $$
and for any $x\in\mathbb{R}^+$
$$ \lim_{n\to +\infty}\frac{\arctan\frac{x}{n}}{\frac{x}{n}}=1 $$
hence by the dominated convergence theorem
$$ \lim_{n\to +\infty}\int_{0}^{n}\frac{\arctan\frac{x}{n}}{\frac{x}{n}}\cdot\frac{dx}{1+x^2}=\int_{0}^{+\infty}\frac{dx}{1+x^2}=\frac{\pi}{2}.$$
In a similar way, since in a right neighbourhood of the origin we have
$$ \frac{\arctan x}{x} = 1-\frac{x^2}{3}+\frac{x^4}{5}-\ldots $$
the second limit equals
$$ -1+\sum_{k\geq 1}\frac{(-1)^k}{(2k-1)(2k+1)}=\color{red}{-\frac{\pi+2}{4}}.$$
Explanation:
$$\begin{eqnarray*}\lim_{n\to +\infty}n\left(\int_{0}^{n}\frac{\arctan\frac{x}{n}}{\frac{x}{n}}\cdot\frac{dx}{1+x^2}-\frac{\pi}{2}\right)&=&\lim_{n\to +\infty}n\left(\int_{0}^{n}\left(\frac{\arctan\frac{x}{n}}{\frac{x}{n}}-1\right)\cdot\frac{dx}{1+x^2}-\arctan\frac{1}{n}\right)\\&=&-1+\lim_{n\to +\infty}n^2\int_{0}^{1}\left(\frac{\arctan x}{x}-1\right)\cdot\frac{dx}{1+n^2 x^2}\\&=&-1+\lim_{n\to +\infty}\int_{0}^{1}\left(\frac{\arctan x}{x}-1\right)\cdot\frac{dx}{x^2+\frac{1}{n^2}}\\(DCT)\quad &=& -1+\int_{0}^{1}\left(\frac{\arctan x}{x}-1\right)\frac{dx}{x^2}\\(Taylor)\quad&=&-1+\int_{0}^{1}\sum_{n\geq 1}\frac{(-1)^n x^{2n-2}}{2n+1}\,dx\\&=&-1+\frac{1}{2}\sum_{k\geq 1}(-1)^k\left(\frac{1}{2k-1}-\frac{1}{2k+1}\right)\\&=&-1+\frac{1}{2}\left[-\arctan(1)-\left(\arctan(1)-1\right)\right]\\&=&-\arctan(1)-\frac{1}{2}.\end{eqnarray*}$$
</s>