TITLE: Using the Mean Value Theorem to Evaluate an Integral of a Sequence of Functions?
QUESTION [7 upvotes]: The following statement should be true, I think, but I'm having a hell of a time trying to prove it:
Let $f_n$ be a $C^1$ function on $[0,a]$, satisfying $f_n = 1$ on $[1/n,a]$ and $0\le f_n \le 1$ and $f_n(0)=0$. Let $\phi$ be a continuous function on $[0,a].$
I want to say that 
$\lim_{n\to\infty} \int_0^a f_n'(x) \phi(x) dx = \phi(0)$.
If $\phi$ is $C^1$, I can just do integration by parts to prove this. But I'm not sure what to do if $\phi$ is just continuous.
This is what I have so far. Using the mean value theorem, we have
$\int_0^a f_n'(x)\phi(x) dx = \int_0^{1/n} f_n'(x)\phi(x) dx= \frac{1}{n}f_n'(c_n) \phi(c_n)$
where $0<c_n<1/n$. 
I think I need to use the mean value theorem on $f_n$ and continuity of $f_n'$ to show that $\frac{1}{n}f_n'(c_n)$ goes to 1 as $n\to\infty$, but I can't seem to figure out how to do this... can someone throw me a hint?

REPLY [5 votes]: For a concrete counterexample, consider the following.
Define $f_n$ on $[0,1/n]$ by
$$
f_n (x) = \cos ^2 \bigg(\frac{\pi }{x}\bigg), \;\; x \in [\alpha_n,1/n],
$$
and
$$
f_n (x) = 0, \;\; x \in [0,\alpha_n],
$$
where $\alpha_n$ is very small compared to $1/n$, and $f_n(\alpha_n)=0$. Note that thus $0 \leq f_n \leq 1$, $f_n (0) = 0$, and $f_n (1/n) = 1$, as required. Then, restricted to the interval $[\alpha_n,1/n]$,
$$
f'_n (x) = 2\cos \bigg(\frac{\pi }{x}\bigg)\sin \bigg(\frac{\pi }{x}\bigg)\frac{\pi }{{x^2 }} = \sin \bigg(\frac{{2\pi }}{x}\bigg)\frac{\pi }{{x^2 }},
$$
and, restricted to the interval $[0,\alpha_n]$,
$$
f'_n (x) = 0.
$$
Note that the issue of smoothness of $f_n$ and $f'_n$ at the endpoints $\alpha_n$ and $1/n$ plays no role for our purposes.
Now, define $\phi $ by
$$
\phi(x) = x\sin \bigg(\frac{{2\pi }}{x}\bigg) ,\;\; x \in (0,a],
$$
and
$$
\phi(0) = 0.
$$
Note that thus $\phi$ is continuous on $[0,a]$. Now,
$$
\int_0^{1/n} {f'_n (x)\phi (x)\,dx}  = \int_{\alpha _n }^{1/n} {f'_n (x)\phi (x)\,dx} = 
\pi \int_{\alpha _n }^{1/n} {\frac{{\sin ^2 (\frac{{2\pi }}{x})}}{x} \,dx} .
$$
A change of variable $x \mapsto 1/x$ then gives
$$
\int_0^{1/n} {f'_n (x)\phi (x)\,dx}  = \pi \int_n^{1/\alpha _n } {\frac{{\sin ^2 (2\pi x)}}{x}\,dx} .
$$
The right-hand side tends to $\infty$ if, for example, $1/\alpha_n > n^2$; then, in particular,
$$
\int_0^{1/n} {f'_n (x)\phi (x)\,dx} \not  \to \phi (0).
$$
EDIT: Particular choice of $\alpha_n$ is not essential here. This follows from the fact that, given any $M > 0$, 
$\int_M^x {\frac{{\sin ^2 (t)}}{t}\,dt} \to \infty$ as $x \to \infty$.
EDIT 2: In fact, $f_n \in C^1 [0,a]$. To show this, it suffices to show that $\lim _{x \downarrow \alpha _n } f'_n (x) = 0$ and $\lim _{x \uparrow 1/n} f'_n (x) = 0$ (this would imply that $f'_n (\alpha_n) = 0$ and $f'_n(1/n)=0$); indeed,
$$
\mathop {\lim }\limits_{x \downarrow \alpha _n } f'_n (x) = f'_n (\alpha _n  + ) = 2\cos \bigg(\frac{\pi }{{\alpha _n }}\bigg)\sin \bigg(\frac{\pi }{{\alpha _n }}\bigg)\frac{\pi }{{\alpha _n^2 }} = 0
$$
(since, by definition, $ \cos ^2 (\frac{\pi }{{\alpha _n }}) = f_n (\alpha_n) = 0$) and
$$
\mathop {\lim }\limits_{x \uparrow 1/n } f'_n (x) = f'_n \bigg(\frac{1}{n} - \bigg) = 2\cos \bigg(\frac{\pi }{{1/n }}\bigg)\sin \bigg(\frac{\pi }{{1/n }}\bigg)\frac{\pi }{{1/n^2 }} = 0
$$
(since $\sin(n \pi)=0$).