# If $\int_{a}^b f(x)g(x) dx = 0$ for all continuous functions $g$ satisfying $g(a) = g(b) = 0$, show $f = 0$

Suppose $f$ is a continuous function over $[a,b]$ and that $\int_{a}^b f(x)g(x) dx = 0$ for all continuous functions $g$ satisfying $g(a) = g(b) = 0$. Show $f = 0$.

We use the mean value theorem to get $g'(c) = 0$ at some point $c$ in the interval. How do I use this to prove that $f = 0$ on $[a,b]$?

• Mean value theorem is not applicable at all. Try a good choice of $g$. – T. Bongers Apr 28 '16 at 3:10
• For each $x_0 \in (a,b)$, consider $g$ which is a "hat function" supported on $[x_0-\delta,x_0+\delta]$ with integral $1$. You will find that $\int_a^b f(x) g(x) dx \approx f(x_0)$. Manage the error in this approximation (using continuity) to conclude that $f(x_0)$ must be zero. Since $x_0$ was arbitrary you get $f=0$. – Ian Apr 28 '16 at 3:15
• Is that even true? If $g(x)=0$ for all $x\in [a,b]$ (which satisfies $g(a)=g(b)=0$) then $f$ does not necessarily have to be the zero function. – Dave Apr 28 '16 at 3:41
• @Dave $f(x)$ must satisfy that for all $g(x)$, not just $g(x) = 0$. – user19405892 Apr 28 '16 at 3:49

Let $g(x)=-(x-a)(x-b)f(x)$. Then $g$ is continous on $[a,b]$ and $g(a)=g(b)=0$
$\int_{a}^{b}f(x)g(x)dx=\int_{a}^{b}-(x-a)(x-b)f^2(x)dx$
For $x\in(a,b)$ $x-a\gt 0$, $x-b\lt 0$ so $-(x-a)(x-b)\gt 0$ and since $f^2(x)\ge 0$ the entire integral is greater than or equal to $0$.
But we know the integral is $0$ so $f^2(x)=0\implies f(x)=0$ for $x\in [a,b]$.