Limit with an integral $\textbf{Problem:}$Let $f:(0,\infty) \to \mathbb{R}$ be a differentiable function, s.t. it's derivate is decreasing in $(0,\infty)$, $f'(x) \ge 0, \forall x \in (0,\infty)$ and $f'(x) \to 0$ when $x \to \infty$ prove that these limit exist:
$$ \lim_{n\to \infty} \left( \frac{1}{2}f(1)+f(2)+ \cdots + f(n-1)+\frac{1}{2}f(n)- \int_{1}^{n} f(x) dx \right) $$
Hint: If $F(x)= \int_{1}^{x} f(t) dt$ prove that $$F(k+\frac{1}{2})-F(k)=\frac{f(k)}{2}+\frac{f'(x_k)}{8}$$ and $$F(k+1)-F(k+\frac{1}{2})=\frac{f(k+1)}{2}+\frac{f'(y_k)}{8}$$ Who are those $x_k,y_k$? Sum these expressions form $k=1$ to $k=n-1$
$\textbf{My try:}$ I'd been struggling with this problem, I tried to use the hint, I want to calculate $F(k+\frac{1}{2})-F(k)$ by the form of the function I can say that:
$$F(k+\frac{1}{2})-F(k)= \int_{1}^{k+\frac{1}{2}}f(t)dt-\int_{1}^{k}f(t)dt=\int_{k}^{k+\frac{1}{2}}f(t)dt$$
And I have the same for the second part of the hint, however I can see how to advance more, how would you proceed?
 A: In order to use the hint, you need to apply Taylor's theorem, which states the following:
If $g\in C^2(\mathbb{R})$, then for any $x,y\in \mathbb{R}$ there exists a $\xi\in[x,y]$ such that
\begin{equation}
g(y)-g(x)=g'(x)\cdot(y-x)+\frac{g''(\xi)}{2}\cdot(y-x)^2.
\end{equation}
If we apply this to your function $F$ for $x=k$ and $y=k+\frac{1}{2}$, we get (Note that $F'=f$ and $F''=f'$)
\begin{equation}
F(k+1/2)-F(k)=\frac{f(k)}{2}+\frac{f'(\xi_k)}{8}, \qquad \qquad (*)
\end{equation}
where $\xi_k\in[k,k+1/2]$.
If we apply the theorem again for $x=k+1$ and $y=k+1/2$, we get
\begin{align}
F(k+1/2)-F(k+1)&=-\frac{f(k+1)}{2}+\frac{f'(\eta_k)}{8}\\
\iff F(k+1)-F(k+1/2)&=\frac{f(k+1)}{2}-\frac{f'(\eta_k)}{8}\qquad \qquad (**)
\end{align}
for some $\eta_k\in[k+1/2,k]$.
If we sum the two equations $(*)$ and $(**)$ from $k=1$ to $k=n-1$, we get
\begin{align}
\int_1^nf(x)dx-\bigg(\frac{1}{2}f(1)+f(2)+\cdots+f(n-1)+\frac{1}{2}f(n)\bigg)=\sum_{k=1}^{n-1}f'(\xi_k)-f'(\eta_k) \qquad (***)
\end{align}
and therefore it suffices to show that the series on the right hand side converges. Since $\xi_k\leq \eta_k$, we immediately infer that $f'(\xi_k)\geq f'(\eta_k)$ and therefore all the summands are greater or equal than zero. Moreover, we know that $k\leq \xi_k$ and $\eta_k\leq k+1$, which implies $f'(k)\geq f'(\xi_k)$ and $f'(\eta_k)\geq f'(k+1)$ and therefore
\begin{align}
0\leq \sum_{k=1}^{n-1}f'(\xi_k)-f'(\eta_k)\leq \sum_{k=1}^{n-1}f'(k)-f'(k+1)\leq f'(1)-f'(n)\leq f'(1).
\end{align}
Since we showed that the series converges, the same holds for the expression on the left hand side of $(***)$.
