Compute $\lim_{n\to\infty} n \bigg( \sum_{k=0}^n f(\frac{k}{n}) - n\int_0^1 f(x) \, dx \bigg)$ The task is to show the following limit exists, and then compute it.  Here,
$\,\mathrm{f}:\left[0,1\right] \to \mathbb{R}$ is a continuously differentiable function.
$$
\lim_{n \to \infty}\left\{n\left[%
\sum_{k = 0}^{n}\,\mathrm{f}\left(k \over n\right) - n\int_{0}^{1}\,\mathrm{f}\left(x\right)\,\mathrm{d}x\right]\right\}
$$
It seems so innocent, it should be easy for me at this point$\ldots$ Could anyone provide some direction or intuition on how to approach such problems&nbsp;?.  Specific hints would be helpful as well.

EDIT:
The comments below discuss why this limit does not exist in general as written.  Perhaps this problem $\left(~\mbox{found on a qualifying exam}~\right)$ had a typo.
We will make some extra assumption on $f(x)$ and shows that under such assumption, the limit diverges unless $f(0)+f(1) = 0$.

Let $f : [0,1] \to \mathbb{R}$ be any $C^2$ function on $[0,1]$, i.e. twice differentiable and the $2^{nd}$ derivative $f''(x)$ is continuous.
For any $0 \le a &lt; b \le 1$, let $h = b - a$ and consider following integral

$$\mathcal{I} \stackrel{def}{=} \int_a^b f''(x) (x-a)(b-x) dx$$
Integrate by parts, it is easy to see

$$\begin{align}
\mathcal{I} 
&amp;= \int_a^b (x-a)(b-x) df'(x) =
\left[(x-a)(b-x)f'(x)\right]_a^b - \int_a^b f'(x)(a+b - 2x) dx\\
&amp;= \int_a^b (2x - (a+b)) df(x)
= \left[(2x-(a+b))f(x)\right]_a^b - 2\int_a^b f(x) dx\\
&amp;= h(f(a)+f(b)) - 2\int_a^b f(x)dx
\end{align}
$$
Notice the factor $(x-a)(b-x)$ is non-negative on $[a,b]$ with $\displaystyle\;\int_a^b (x-a)(b-x) dx = \frac{h^3}{6}\;$.
If $M$ and $m$ is the maximum and mimumum of $f''(x)$ over $[a,b]$, we have following bound for $\mathcal{I}$.

$$m\frac{h^3}{6} \le \mathcal{I} \le M\frac{h^3}{6}$$

Since $f''(x)$ is continuous over $[a,b]$, by IVT, there exists an $c \in (a,b)$ such that $$\mathcal{I} = f''(c)\frac{h^3}{6}$$

Now for any fixed $n &gt; 1$, sub divide $[0,1]$ into $n$ subintervals $[a_k,b_k] = \left[\frac{k}{n},\frac{k+1}{n}\right]$ for $0 \le k &lt; n$. Apply result above,
we find there are $c_k \in [a_k,b_k]$ such that

$$\frac{1}{12n^3} f''(c_k) = \frac{1}{2n}\left(f(a_k)+f(b_k)\right) - \int_{a_k}^{b_k} f(x)dx$$
Summing over $k$ give us

$$n\left\{
\sum_{k=0}^{n-1} \frac12\left[
f\left(\frac{k}{n}\right)
+f\left(\frac{k+1}{n}\right)
\right] - n\int_0^1 f(x)dx
\right\} = \frac{1}{12n}\sum_{k=0}^{n-1}f''(c_k)$$

The RHS has the form of a Riemann sum over $f''(x)$. This means as $n \to \infty$,
the limit of LHS exists and equals to
$$\lim_{n\to\infty} n\left\{
\sum_{k=0}^{n-1} \frac12\left[
f\left(\frac{k}{n}\right)
+f\left(\frac{k+1}{n}\right)
\right] - n\int_0^1 f(x)dx
\right\}\\ = \frac{1}{12} \int_0^1 f''(x)dx
= \frac{1}{12} (f'(1)-f'(0))\tag{*1}
$$
Compare this with the sequence in question, we find

$$n\left\{\sum_{k=0}^n f\left(\frac{k}{n}\right) - n\int_0^1 f(x)dx\right\}
= \frac{n}{2}(f(0)+f(1)) + \frac{1}{12}(f'(1)-f'(0)) + o(1)
$$
From this, we find unless $f(0)+f(1) = 0$, the sequence at hand contains a term proportional to $n$ and diverges in general. If $f(0)+f(1) = 0$, the limit do
exists and equals to $\frac{1}{12}(f'(1) - f'(0))$.

As mentioned in comment, this is essentially
Euler Maclaurin formula of approximating the integral over $[0,1]$.

As a side note, I think the condition $f$ is $C^2$ can be relaxed. However, I don't know the exact condition for $(*1)$ to be true. $C^2$ is simply the condition one can prove what one need directly.
Here is a start.

Factor out a $n$ from inside and rearrange things and you get the following

$\lim_{n \rightarrow \infty} \frac{ \frac{1}{n} \sum_{i=1}^n f(\frac{k}{n}) - \int_0^1 f(x) dx}{\frac{1}{n^2}} = \frac{0}{0}$

The top zero is because you have a Riemann approximation (the summation) which approaches exactly your integral.  So from here we could do l'hospital's rule (you just have to be careful with doing derivatives of summations that depend on the variable)