<s>[INST] Help with $ \lim \frac{n\pi}{4} - \left( \frac{n^2}{n^2+1^2} +\frac{n^2}{n^2+2^2} + \cdots + \frac{n^2}{n^2+n^2} \right) $ I have proved that $$\lim_{n\to \infty} \left( \frac{n}{n^2+1^2} +\frac{n}{n^2+2^2} + \cdots + \frac{n}{n^2+n^2}  \right)  = \frac{\pi}{4},$$
by using the Riemann's sum of $\arctan$ on $[0,1]$. Now I'm interested in computing the next limit
$$ L=\lim_{n\to \infty} \left[ \frac{n\pi}{4} - \left( \frac{n^2}{n^2+1^2} +\frac{n^2}{n^2+2^2} + \cdots + \frac{n^2}{n^2+n^2}  \right) \right] $$
Note that
$$ L= \lim n  \left[ \frac{\pi}{4} - \left( \frac{n}{n^2+1^2} +\frac{n}{n^2+2^2} + \cdots + \frac{n}{n^2+n^2}  \right) \right] =[\infty \cdot 0].$$
I can't manage to calculate $L$. How can this indeterminate form be solved? Also, by using computer, I suspect that $L$ exists and is equal to $1/4$. Any idea or hint is welcome! (Actually, I dont need a complete solution, just a good start point). Have a nice day you all!
 [/INST] By Taylor's formula
$$
\frac{1}{{1 + (x/n)^2 }} = \frac{1}{{1 + (k/n)^2 }} - \frac{1}{n}\frac{{2k/n}}{{(1 + (k/n)^2 )^2 }}(x - k) + \frac{{(3(\xi /n)^2  - 1)}}{{(1 + (\xi /n)^2 )^3 }}\frac{1}{{n^2 }}(x - k)^2 .
$$
for $0<x<n$, $0\leq k\leq n$ and some $0<\xi<n$ depending on $x$, $k$ and $n$. Since
$$
\left|\frac{{(3(\xi /n)^2  - 1)}}{{(1 + (\xi /n)^2 )^3}} \right|\leq 1
$$
for any $0<\xi<n$, we can write
$$
\frac{1}{{1 + (x/n)^2 }} = \frac{1}{{1 + (k/n)^2 }} - \frac{1}{n}\frac{{2k/n}}{{(1 + (k/n)^2 )^2 }}(x - k) + \mathcal{O}\left(\frac{1}{{n^2 }}\right)(x - k)^2
$$
uniformly for $0<x<n$ and $0\leq k\leq n$. Thus
$$
\int_{k - 1}^k {\frac{{dx}}{{1 + (x/n)^2 }}}  = \frac{1}{{1 + (k/n)^2 }} + \frac{1}{n}\frac{{k/n}}{{(1 + (k/n)^2 )^2 }} + \mathcal{O}\!\left( {\frac{1}{{n^2 }}} \right),
$$
and so
$$
\frac{1}{n}\sum\limits_{k = 1}^n {\frac{1}{{1 + (k/n)^2 }}}  = \frac{1}{n}\int_0^n {\frac{{dx}}{{1 + (x/n)^2 }}}  - \frac{1}{{n^2 }}\sum\limits_{k = 1}^n {\frac{{k/n}}{{(1 + (k/n)^2 )^2 }}}  + \mathcal{O}\!\left( {\frac{1}{{n^2 }}} \right),
$$
i.e.,
$$
\sum\limits_{k = 1}^n {\frac{{n^2 }}{{n^2  + k^2 }}}  = \frac{\pi }{4}n - \frac{1}{n}\sum\limits_{k = 1}^n {\frac{{k/n}}{{(1 + (k/n)^2 )^2 }}}  +\mathcal{O}\!\left( {\frac{1}{n}} \right).
$$
Finally,
$$
\frac{\pi }{4}n - \sum\limits_{k = 1}^n {\frac{{n^2 }}{{n^2  + k^2 }}}  = \frac{1}{n}\sum\limits_{k = 1}^n {\frac{{k/n}}{{(1 + (k/n)^2 )^2 }}}  + \mathcal{O}\!\left( {\frac{1}{n}} \right) \to \int_0^1 {\frac{x}{{(1 + x^2 )^2 }}dx}  = \frac{1}{4}.
$$
</s>