TITLE: For $f$ continuous, show $\lim_{n\to\infty} n\int_0^1 f(x)x^n\,dx = f(1).$
QUESTION [20 upvotes]: Suppose $f:[0,1]\to \mathbb{R}$ is continuous. Show that 
$$\lim_{n\to\infty} n\int_0^1 f(x)x^n\,dx = f(1).$$
My answer so far: First I want to assume that $f\in C^1$. Then 
$$n\int_0^1f(x)x^n\,dx = \left[\frac{n}{n+1}x^{n+1}f(x)\right]_0^1 - \frac{n}{n+1}\int_0^1 x^{n+1}f'(x)\, dx\\
\frac{n}{n+1}f(1) - \frac{n}{n+1}\int_0^1 x^{n+1}f'(x)\, dx,$$
which goes to $f(1)$ because the last integral goes to zero.
But approximating $f$ by $\phi\in C^1$ won't necessarily work, because $\phi(1)$ may not equal $f(1)$... how can we finish the argument?

REPLY [5 votes]: Thought I'd write out the polynomial method @Kunnysan mentioned in the comments.
Consider an arbitrary polynomial $p(x) = a_0 + a_1x + \dots + a_kx^k$. We can calculate
\begin{align}
\lim_{n \rightarrow \infty} n \int_0^1 p(x)x^n \, dx &= 
\lim_{n \rightarrow \infty} n \int_0^1 a_0x^n + a_1x^{n+1} + \dots + a_kx^{n+k} \, dx \\
&= \lim_{n \rightarrow \infty} \left( \frac{n}{n+1} a_0 + \frac{n}{n+2} a_1 + \dots + \frac{n}{n+k} a_k \right) \\
&= a_0 + a_1 + \dots + a_k \\
&= p(1)
\end{align}
By the Weierstrass approximation theorem there exists a sequence of polynomials $\{p_m\}$ such that $p_m(x) \rightarrow f(x)$ uniformly.
We then write
\begin{align}
\lim_{n \rightarrow \infty} n\int_0^1 f(x)x^n \, dx &= \lim_{n \rightarrow \infty} n \int_0^1 \lim_{m \rightarrow \infty} p_m(x)) x^n \, dx \\
&= \lim_{n\rightarrow n} n \int_0^1 \lim_{m \rightarrow \infty} p_m(x)x^n \, dx \\
&= \lim_{n \rightarrow \infty} \lim_{m \rightarrow \infty} \int_0^1 p_m(x)x^n \, dx
\end{align}
where the interchanging of the limit and the integral is valid because the sequence $p_m(x)x^n$ converges uniformly to $f(x)x^n$.
Since $p_m(x)$ is a polynomial, we can use our preliminary work to write
$$ \lim_{n \rightarrow \infty} \lim_{m \rightarrow \infty} \int_0^1 p_m(x)x^n \, dx =
\lim_{n \rightarrow \infty} \lim_{m \rightarrow \infty} \left( \frac{n}{n+1} a_0 + \frac{n}{n+2} a_1 + \dots + \frac{n}{n+k} a_k \right)$$
where $a_i$ are the coefficients of the polynomial $p_m(x)$.
Lastly we interchange limits again, first taking the limit as $n \rightarrow \infty$:
$$\lim_{n \rightarrow \infty} \lim_{m \rightarrow \infty} \left( \frac{n}{n+1} a_0 + \frac{n}{n+2} a_1 + \dots + \frac{n}{n+k} a_k \right) = \lim_{m \rightarrow \infty} p_m(1) = f(1)$$