Calculate:
$\displaystyle \lim_{n \rightarrow \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)$.
I solved it by taking into account that $\displaystyle \int_0^{1} \frac{1}{1+x^2} \mathrm{d}x = \frac{\pi}{4}$ and let the given sequence be:
$a_n= \displaystyle \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)$
Let $f(x) = \frac{1}{1+x^2}$, then:
$a_n = \displaystyle \frac{n \pi}{4} - \sum_{i=1}^n \frac{1}{1+\left( \frac{i}{n} \right)^2} = n \int_0^{1} f(x) \mathrm{d}x - \sum_{i=1}^n f\left( \frac{i}{n} \right) = n \sum_{i=1}^n \int_{\frac{i-1}{n}}^{\frac{i}{n}} f(x) \mathrm{d}x - n \sum_{i=1}^n \int_{\frac{i-1}{n}}^{\frac{i}{n}} f\left( \frac{i}{n} \right) \mathrm{d}x = n \sum_{i=1}^n \int_{\frac{i-1}{n}}^{\frac{i}{n}} \left( f(x)- f\left( \frac{i}{n} \right) \right) \mathrm{d}x$
Using Mean Value Theorem and doing a lot of calculations, I finally get that the limit is $\displaystyle \frac{1}{4}$.
Is it correct? Is there an easier method to solve the problem?