Calculate $\lim_{n \to +\infty} \int_{0}^{+\infty} \frac{n \sin(\frac{x}{n})}{1 + x^2} dx$ The question is as follows:
Calculate $\lim_{n \to +\infty} \int_{0}^{+\infty} \frac{n \sin(\frac{x}{n})}{1 + x^2} dx$.
$\textbf{Some ideas:}$
We can use the fact that $\sin(\frac{x}{n}) \simeq \frac{x}{n} $.But then we find that 
$\lim_{n \to +\infty} \int_{0}^{+\infty} \frac{n \sin(\frac{x}{n})}{1 + x^2} dx \simeq \lim_{n \to +\infty} \int_{0}^{+\infty} \frac{n  \times \frac{x}{n}}{1 + x^2} = \lim_{n \to +\infty} \int_{0}^{n} \frac{ x }{1 + x^2} dx $
$ \hspace{9.1cm} = \lim_{n \to +\infty} \frac{1}{2}\int_{0}^{n} \frac{ 2x }{1 + x^2} dx   $
$ \hspace{9.1cm} \text{take } x^2=y$
$ \hspace{9.1cm} = \lim_{n \to +\infty} \frac{1}{2}\int \frac{ dy }{1 + y} $
$ \hspace{9.1cm} = \lim_{n \to +\infty} \frac{\ln(y)}{2} $
$\hspace{9.1cm} = \lim_{n \to +\infty} \frac{\ln(x^2)}{2} \mid_{0}^{n}$
$\hspace{9.1cm} = \lim_{n \to +\infty} \frac{\ln(n^2)}{2} = +\infty$
But someone said me that the final result should be $\frac{\pi}{2}$?
Can you please let me know where is my mistake?
Thanks!
 A: This is too long to be in the comment section. The purpose of this post is to compute
\begin{align}
\int^\infty_0 \frac{n\sin^2\frac{x}{n}}{1+x^2}\ dx
\end{align}
exactly (not the limit). This is a harder way to show that the limit of my proposed revision of the problem is indeed $\pi/2$. 
First, note that the integrand is integrable for all values of $n$. Next, observe
\begin{align}
\int^\infty_0 \frac{n\sin^2 \frac{x}{n}}{1+x^2}\ dx =&\ \frac{n}{2}\int^\infty_0 \frac{1}{1+x^2}\ dx -\frac{n}{2}\int^\infty_0\frac{\cos \frac{2x}{n}}{1+x^2}\ dx \\
=&\  \frac{n\pi}{4} - \frac{n}{4} \int^\infty_{-\infty} \frac{\exp(i\frac{2x}{n})}{1+x^2}\ dx. 
\end{align} 
Now, using contour integration, we can show that
\begin{align}
\int^\infty_{-\infty} \frac{\exp(i\frac{2x}{n})}{1+x^2}\ dx = \pi e^{-2/n}.
\end{align}
Hence it follows
\begin{align}
\int^\infty_0 \frac{n\sin^2\frac{x}{n}}{1+x^2}\ dx = \frac{n\pi}{4}\left( 1- e^{-2/n}\right) = \frac{\pi}{2}ne^{-1/n}\sinh n^{-1}.
\end{align}
Finally, let us make the observation that for $n$ large we have that
\begin{align}
1-e^{-2/n} = \frac{2}{n}+\mathcal{O}\left(\frac{1}{n^2}\right)
\end{align}
which means
\begin{align}
\int^\infty_0 \frac{n\sin^2\frac{x}{n}}{1+x^2}\ dx = \frac{\pi}{2}+\mathcal{O}\left(\frac{1}{n}\right).
\end{align}
Thus, as $n\rightarrow \infty$, we see that the integral approaches $\pi/2$. 
A: Here I will show, more-or-less rigorously, that the original integral diverges logarithmically, as taking the limit inside the integral would suggest. (Mathematica actually gives a closed form solution in terms of hyperbolic inverse functions for the integral at finite $n$, but we'll pretend we don't know it.)
We do the change of variables $$ \int_0^\infty \frac{n\sin(x/n)}{x^2+1}\;dx = \int_0^\infty \frac{\sin(x)}{x^2+1/n^2}\;dx$$ and then split up the integral into $\int_0^1+\int_1^\infty$. In the second piece, the limit can be taken under the integral since the convergence is uniform on $(1,\infty)$ and we get $\int_1^\infty \frac{\sin(x)}{x^2} dx= \int_0^1 \sin(1/x)dx.$ The first piece we can rewrite as $$\int_{0}^1\frac{x}{x^2+1/n^2}\;dx +\int_0^1 \frac{\sin(x)-x}{x^2+1/n^2}\;dx. $$ The second integral no longer has a divergence at the origin, so the limit can be taken inside it. The first term is just $$ \frac{1}{2}\log(n^2+1).$$ So we finally get $$ \int_0^\infty \frac{n\sin(x/n)}{x^2+1}\;dx = \frac{1}{2}\log(n^2+1) + \int_0^1 \left(\frac{\sin(x)-x}{x^2}+\sin(1/x)\right)\;dx  + o(1) \sim \log(n)$$
