To prove using the mean value theorem. Task:
Let $f(x)$ does not increase on $[1;+\infty]$ and $f\left(n\right)=\frac{1}{\sqrt{n}}$ when $n∈N$.  
To prove:
$\lim _n\int _n^{n^2}f\left(x\right)-ln\left(x\right)dx=+\infty \:$
Please, help me with this problem. I can't even find examples on this topic.
 A: We are asked to evaluate the limit
$$\lim_{n\to \infty}\int_n^{n^2}\left(f(x)-\log x\right)\,dx \tag 1$$
where $f$ is bounded above by $1/\sqrt{x}$.  The log function can be integrated in closed form, the result of which is 
$$\int_n^{n^2}\log x=2n^2\log n-n^2-n\log n+n\tag 2$$
For the integral of $f$, we have 
$$\begin{align}
\int_n^{n^2} f(x)\,dx&<\int_n^{n^2}\frac{1}{\sqrt{x}}\,dx\\\\
&=2n-2\sqrt{n}\tag 3
\end{align}$$
Using $(2)$ and $(3)$ we find that
$$\int_n^{n^2}\left(f(x)-\log x\right)\,dx<\left(2n-2\sqrt{n}\right)-\left(2n^2\log n-n^2-n\log n+n\right)$$
which clearly goes to $-\infty$ as $n\to \infty$

We could have used the Mean Value Theorem for Integrals to arrive at the same result.  There, we would have written
$$\int_n^{n^2}f(x)\,dx=f(\xi)(n^2-n)$$
for $n<\xi<n^2$.  But we know that $f$ is bounded above by the square root.  Therefore, we have
$$\int_n^{n^2}f(x)\,dx=f(\xi)(n^2-n)\le\frac{n^2-n}{\sqrt{n}} \tag 4$$
Using $(4)$, we have
$$\int_n^{n^2}\left(f(x)-\log x\right)\,dx<\left(\frac{n^2-n}{\sqrt{n}}\right)-\left(2n^2\log n-n^2-n\log n+n\right)$$
which also clearly approaches $-\infty$ as $n\to \infty$.
