<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] Let $f(x):=\frac{1}{1+x^2}$ so$$L=\lim_{n\to\infty}L_n,\,L_n:=n\int_0^1f(x)dx-\sum_{i=1}^nf(i/n).$$Taylor-expanding $f$,$$L_n=\sum_{k\ge1}\frac{f^{(k)}(0)}{k!}c_{nk},\,c_{nk}:=n\int_0^1x^kdx-\frac{1}{n^k}\sum_{i=1}^ni^k\sim-\tfrac12$$by Falhaber's formula. So$$L=-\tfrac12\sum_{k\ge1}\frac{f^{(k)}(0)}{k!}=-\tfrac12(f(1)-f(0))=\tfrac14.$$
</s>