<s>[INST] How to calculate this integral using dominated convergence theorem? 
I want to calculate
  $$\lim_{n\to\infty}\int_{n^{-1}}^n \frac{n^2xe^{-n^2x^2}}{1+x^2}\,dx\tag{1}$$

I have used two approach but get different answer.
(1) take $y=n^2x^2$, then 
$$(1)=\lim_{n\to\infty}\int_1^{n^4}\frac{e^{-y}}{2(1+\frac{y}{n^2})}\,dy$$
$\frac{e^{-y}}{2(1+\frac{y}{n^2})}1_{[1,n^4]}(y)$ is dominated by $e^{-y}$ which is integrable, then by dominated convergence theorem we get $(1)=(2e)^{-1}$
(2) take $g(n)=\frac{n^2xe^{-n^2x^2}}{1+x^2}$, "differentiate" wrt $n$
$$g'(n)=\frac{2(1-n^2x^2)nxe^{-n^2x^2}}{1+x^2}\tag{3}$$
since $x\in[n^{-1},n]$, then $g'(n)<0$, so for all $x\in[n^{-1},n]$, $g(n)\le g(1)=\frac{xe^{-x^2}}{1+x^2}$ , then
$$\frac{n^2xe^{-n^2x^2}}{1+x^2}1_{[n^{-1},n]}(x)\le\frac{xe^{-x^2}}{1+x^2}\tag{2}$$
which is integrable, then by dominated convergence theorem, we get $(1)=0$
I am confused about what's wrong with my application of dominated convergence theorem, any help will be appreciated!
 [/INST] The first approach is correct.  However, there is a flaw in the second one.
Note that $g'(n)=\frac{2(1-n^2x^2)nxe^{-n^2x^2}}{1+x^2}=0$ when $n=1/x$.  And at the maximum, $g(1/x)=\frac{e^{-1}}{x(1+x^2)}$, which is not integrable for $x\in [0,1]$.

The proposed dominating function, $\frac{xe^{-x^2}}{1+x^2}$ does not, in fact, dominate $g(n)=\frac{n^2xe^{-n^2x^2}}{1+x^2}$ for all $x\in [1/n,n]$.  
At $x=1/n$, we have $g(n)=ne^{-1}> \frac1n e^{-1/n^2}$ for $n>1$.


One way around this difficulty is to write
$$\begin{align}
\int_{1/n}^n\frac{n^2xe^{-n^2x^2}}{1+x^2}\,dx&=\int_{1/n}^n n^2xe^{-n^2x^2}\,dx-\int_{1/n}^n\frac{n^2x^3e^{-n^2x^2}}{1+x^2}\,dx\\\\
&=\frac12 (e^{-1}-e^{-n^4})-\int_{1/n}^1\frac{n^2x^3e^{-n^2x^2}}{1+x^2}\,dx-\int_{1}^n\frac{n^2x^3e^{-n^2x^2}}{1+x^2}\,dx \tag 1
\end{align}$$
Now, let $h_n(x)=\frac{n^2x^3e^{-n^2x^2}}{1+x^2}$.  Then, it is easy to show that $h_n(x)\le \frac{xe^{-1}}{1+x^2}$.  So,  the DCT guarantees that the first integral on the right-hand side of $(1)$ approaches $0$.
For the second integral, we note that for $x\ge 1$, $h_n(x)\le \frac{x^3e^{-x}}{1+x^2}$.  Therefore, the DCT guarantees that the second integral on the right-hand side of $(1)$ also approaches $0$.
Hence, we have
$$\bbox[5px,border:2px solid #C0A000]{\lim_{n\to \infty}\int_{1/n}^n\frac{n^2xe^{-n^2x^2}}{1+x^2}\,dx=\frac{e^{-1}}{2}}$$
as expected!
</s>