# Prove that a function is equal to a constant.

Assume that $f(x)$ is continuous on $[a,b]$. And for any continuous function $g$ if $\int_a^bg(x)dx=0$ then $\int_a^bf(x)g(x)dx=0$, show that $f(x)$ is a constant.

I tried to convert this question to show$f'(x)\equiv0$ but this seems impossible by using the mean value theorem or the Rolle theorem. Any ideas?

• What do you mean any integration? Do you mean that for any two real numbers $(a,b)$ the following holds or for any function $g(x)$ with $\int_{a}^{b}g(x)dx=0$? – Tucker Aug 11 '15 at 1:54
• @Tucker a and b are two real numbers and $g(x)$ is a random function meet $\int_a^bg(x)dx=0$. Thanks to point out – Rowan Aug 11 '15 at 2:02
• No, $g(x)$ is no "a random" function. It has to be true in general that if $g(x)$ is any function with this property, then $\int_a^b f(x)g(x)\,dx =0$ If $g(x)$ is one "random" function, whatever that is, you do not get this result. Language is really important in mathematics. – Thomas Andrews Aug 11 '15 at 2:08
• @ThomasAndrews Thanks a lot. I finished my problem by using the outline. And have you deleted your answer? I can't find it now. – Rowan Aug 11 '15 at 2:21
• @ThomasAndrews Now it appears again. It's my network error. – Rowan Aug 11 '15 at 2:28

## 3 Answers

Take $g(x)=f(x)-\dfrac{1}{b-a}\int_a^b f(x) dx$. Certainly for this choice of $g$, we have that $g$ is continuous and $\int_a^b g(x) dx=0$

We then observe that if $\int_a^b f(x)\,g(x)\,dx=0$, then

$$\int_a^b f^2(x)dx=\dfrac{1}{b-a}\left(\int_a^b f(x) dx\right)^2$$

But by the Cauchy-Scwartz Inequality

$$\left(\int_a^b f(x) dx\right)^2\le \int_a^b f^2(x)\, dx\,\,\int_a^b (1)^2\,dx\implies\,\int_a^b f^2(x)\, dx\ge \dfrac{1}{b-a}\left(\int_a^b f(x) dx\right)^2$$

with equality holding only when $f(x)$ is a constant. And that is that!

• You did it again. Nice!!! +1 ;) Do you have an account for chatting by the way? – johannesvalks Aug 11 '15 at 2:22
• @johannesvalksThanks!!! We can chat here somehow and I can give you my personal e-mail. – Mark Viola Aug 11 '15 at 2:27
• Using Cauchy-Schwarz was really innovative. +1 – Paramanand Singh Aug 11 '15 at 3:45
• @ParamanandSingh Wow! Hey, thank you!! As you might know, I had my forth surgery in the past 15 months just 6 weeks ago and am in recovery. You kind words means a lot to me!! – Mark Viola Aug 11 '15 at 3:48
• Would the cowardly down voter care to state his/her rationale? – Mark Viola Feb 22 '16 at 20:16

Outline, with some middle steps missing.

Show that if the above is true for $f$, the it is true for $f_1(x)=f(x)-C$ for $C$ any constant. Then show:

$$\int_a^b f_1(x)\,dx = 0$$

For a parrticular $C$.

So, let $g(x)=f_1(x)$ and we get tht:

$$\int_a^b f_1(x)^2 \,dx = 0$$

Therefore, show $f_1(x)=0$ for all $x$, and thus that $f(x)=C$ for all $x$.

Your idea of showing $f'(x)\equiv 0$ doesn't work because $f$ is not necessarily differentiable. However, it can be done if we assume that $f$ has a continuous derivative.

Let $G$ be a differentiable function on $[a,b]$ with $G(a)=G(b)=0$. Now $g=G'$ has $\int_a^b g(x) dx = 0$, so integrating by parts, we get $$\int_a^b f'(x) G(x) \,dx = \left[f(x) G(x) \right]_{x=a}^b - \int_a^b f(x)g(x)\,dx = 0.$$

If $f'(x)$ is nonzero at any point, then because $f'$ is continuous there is an open interval $(c,d) \subseteq [a,b]$ where $f'$ has only one sign. Without loss of generality, let's assume $f'$ is positive in $(c,d)$ (otherwise we may consider $-f'$ in the following). Let $G$ be a function which is zero outside $(c,d)$ and has positive values in $(c,d)$. (Such a function exists but giving a full definition here would be troublesome because $G$ needs to be continuous so I'll skip it.) Then $$\int_a^b f'(x) G(x) \,dx > 0,$$ which is a contradiction.

• Thank you. I spent a lot of time to understand your answer :) Something used to be vague now seems more clear. – Rowan Aug 11 '15 at 15:49