# 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!

• That idea is, more or less, what Gary shows in his solution, isn't it? Apr 21 at 17:11
• For any $f \in C^1([0,1])$ we have the general result $\lim_{n \to \infty} n\left(\int_0^1 f(x) \, dx - \frac{1}{n}\sum_{k=1}^n f(k/n) \right) = \frac{f(0) -f(1)}{2}$. It is not generally true if $f$ is not continuously differentiable. See this answer.
– RRL
Apr 21 at 17:42
• Thanks RRL for that reference! It's very interesting. Apr 21 at 17:57
• @RRL: that's a result which I have used often, for example in this answer. The answer has some links to other posts containing proofs of the result. Apr 22 at 2:41
• @ParamanandSingh: Yes -- it comes up here from time to time. It seems to hold under the weaker condition that $f'$ is integrable and Daniel Fischer proved it does not hold for all $f \in C([0,1])$. What is an interesting exercise is to find a concrete example of a continuous function where it fails to hold.
– RRL
Apr 22 at 17:07

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, $$0\leq k\leq n$$ and some $$0<\xi 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, 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 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}.$$

• Woah... Taylor... I should have figured this out... Thanks for your solution +1! Apr 21 at 17:13
• This looks promising. However, the $\mathcal{O}\!\left( {\frac{1}{{n^2 }}}\right)$ depends on $n$ but also on $k$. You need to properly justify that this dependence doesn't influence the final result. Apr 21 at 17:15
• @mathcounterexamples.net Thanks. Originally, I looked at the error term for all $0\leq k \leq n$ and found that it is uniformly $\mathcal{O}(n^{-2})$. I made the necessary changes.
– Gary
Apr 21 at 17:19
• @Gary Your new formula still depends a priori on $k$. You need I think to exhibit the next term of the Taylor series and bound in by something independent of $k$. This is not evident. At least for me. Apr 21 at 17:31
• @mathcounterexamples.net You can write the remainder explicitly as $$\frac{{(3(\xi /n)^2 - 1)}}{{(1 + (\xi /n)^2 )^3 }}\frac{1}{{n^2 }}(x - k)^2$$ where $0<\xi<n$. The factor depending on $\xi$ is at most $1$.
– Gary
Apr 21 at 17:36

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.$$

• Thanks for your solution, +1! Unfortunately, I was not familiar with Falhaber formula so I would never come up with your solution. Apr 21 at 17:12
• @Senna You could also use Euler-Maclaurin.
– J.G.
Apr 21 at 17:13
• What do you mean by Euler-Mclaurin? Apr 21 at 17:16