TITLE: How prove this $f(n)\le f(n+1)$ where $f(n)=\sum_{k=1}^{n}\frac{n}{n^2+k^2}$
QUESTION [21 upvotes]: let $$f(n)=\sum_{k=1}^{n}\dfrac{n}{n^2+k^2}$$
prove or disprove 
$$f(n)\le f(n+1)$$
this inequality is found when I deal this  follow limit: 
$$\lim_{n\to\infty}f(n)=\lim_{n\to\infty}\dfrac{1}{n}\sum_{k=1}^{n}\dfrac{1}{1+(k/n)^2}=\int_{0}^{1}\dfrac{1}{1+x^2}dx=\dfrac{\pi}{4}$$
But I can't prove 
$$f(n)\le f(n+1)$$
since
$$f(n+1)=\dfrac{n+1}{(n+1)^2+1}+\dfrac{n+1}{(n+1)^2+2^2}+\cdots+\dfrac{n+1}{(n+1)^2+n^2}+\dfrac{n+1}{(n+1)^2+(n+1)^2}$$
$$f(n)=\dfrac{n}{n^2+1}+\dfrac{n}{n^2+2^2}+\cdots+\dfrac{n}{n^2+n^2}$$
so
$$f(n+1)-f(n)=\left(\dfrac{n+1}{(n+1)^2+1}-\dfrac{n}{n^2+1}\right)+\left(\dfrac{n+1}{(n+1)^2+2^2}-\dfrac{n}{n^2+2^2}\right)+\cdots+\left(\dfrac{n+1}{(n+1)^2+n^2}-\dfrac{n}{n^2+n^2}\right)+\dfrac{1}{2(n+1)}$$
so
$$f(n+1)-f(n)=\sum_{k=1}^{n}\dfrac{k^2-n^2-n}{(k^2+n^2)((n+1)^2+k^2)}+\dfrac{1}{2(n+1)}$$
This problem is my  found it,can you help to solve this problem?

REPLY [2 votes]: The inequality is true for large $n$ based on general principles, but having it for all $n$ starting from $n=1$ is "accidental".
For any smooth function $g(x)$ on a closed finite interval, its Riemann sums $f(n)$ (for any of the usual choices of $n$ points and their weights) have an asymptotic expansion in powers of $1/n$.  Therefore an expansion $(f(n+1)- f(n)) \sim \frac{A}{n} + \frac{B}{n^2} + \dots$ also exists and the sign of the first nonzero term will determine the direction of monotonicity, for large $n$.  Euler-Maclaurin formula with remainder can be used to find $n_0$ such that the monotonicity holds for $n \geq n_0$, but monotonicity can fail for small $n$.  
In this problem the direction of monotonicity is known without calculations, because $f(n)$ is the upper-endpoint Riemann sum of a decreasing function $g(x)$, so that $f(2n) \geq f(n)$ from one Riemann partition refining the other.  We know this way that $f(n)$ is eventually increasing.
For a decreasing convex $g(x)$, with $g' \leq 0 \leq g''$ the $f(n)$ type of Riemann sums do monotonically increase for all $n \geq 1$. This is a frequently rediscovered theorem but it does not apply to $g(x)=\frac{1}{1+x^2}$ on $[0,1]$ because $g''(x)$ changes sign in that interval.  Apparently there is nothing more that can be done except to compute the first terms in the Euler-Maclaurin formula, estimate the error term (which for this problem means determining a bound on $|g''|$) to compute an $n_0$, and check the inequality for smaller $n$ by computation.  Which is exactly what is done in the other answers that reached a conclusion.
It is interesting that this problem was found by calculation with small $n$, because according to this analysis those are the $n$ that do not matter and can violate the general pattern that does hold for large $n$.