# A consequence of the Mean Value Theorem for Integrals

Suppose that $f,g: [a,b] \rightarrow R$ are continuous functions. Its true that exists $a \leq c \leq b$, $$\int _a^b f(x)g(x) dx = f(c) \int_a^b g(x) dx ?$$ And if $g \geq 0$ what happens?

This is a exercise of my course of Measure and Integration and I have not idea to how do this.

• Hint: Use the Weierstrass Theorem: en.wikipedia.org/wiki/Extreme_value_theorem – Nigel Overmars Jan 7 '14 at 16:26
• Can you detail for me? – Felipe Jan 7 '14 at 16:50
• I can try, but the proof of this fact was given to me yesterday. So giving adequate hints will be kind of difficult without spoiling it. – Nigel Overmars Jan 7 '14 at 16:58
• Uow! I need to learn to look right in this forum. I am a new user, and in many ways I tried searching but found nothing close to it. – Felipe Jan 7 '14 at 17:00

Let $a,b \in \mathbb{R}$ with $a \lt b$. Let $f,g : [a,b] \to \mathbb{R}$ be continuous such that $g(x) \geq 0$ for all $x \in [a,b]$

Since the interval $[a,b]$ is compact and $f$ is continuous, by the Weierstrass Theorem, there exists $m,M \in \mathbb{R}$ such that $m \leq f(x) \leq M$ for all $x \in [a,b]$ and there exists $x_1,x_2 \in [a,b]$ such that $f(x_1)=m$ and $f(x_2)=M$.

For all $x \in [a,b]$, $\: mg(x) \leq f(x) g(x) \leq Mg(x)$ since $g(x) \geq 0$ for all $x \in \mathbb{R}$. Integration gives: $$\int_a^b mg(x)dx \leq \int_a^b f(x)g(x)dx \leq \int_a^b Mg(x)dx$$ Which is equivalent to: $$m\int_a^b g(x)dx \leq \int_a^b f(x)g(x)dx \leq M \int_a^b g(x)dx \hspace{5mm} (*)$$ If $\int_a^b g(x)dx=0$, then for all $c \in [a,b]$, $\int_a^b f(x)g(x)dx=f(c)\int_a^b g(x)dx$.

From now on, assume $\int_a^b g(x) dx \gt 0$.

Then $(*)$ is equivalent to: $$m \leq \frac{\int_a^b f(x)g(x)dx}{\int_a^b g(x)dx} \leq M$$ Then, by the Intermediate Value Theorem, there exists a $c \in [a,b]$ such that: $$f(c) = \frac{\int_a^b f(x)g(x)dx}{\int_a^b g(x)dx} \Longrightarrow \int_a^b f(x)g(x)dx = f(c)\int_a^b g(x)dx$$

It is not true in general. Let $a=0,b=2 \pi, f=g=\sin$. Then $\int_a^b f(x)g(x)dx >0$, but $\int_a^b g(x)dx = 0$.

If $g \ge 0$, then it is true:

If $g=0$, its is clearly true, so suppose $g \neq 0$ (and hence$\int_a^b g(x)dx > 0$).

Let $\overline{f} = \max_{x \in [a,b]} f(x)$, and $\underline{f} = \min_{x \in [a,b]} f(x)$.

Then $\underline{f} \int_a^b g(x)dx \le \int_a^b f(x)g(x)dx \le \overline{f} \int_a^b g(x)dx$. Hence we can choose some $c \in [a,b]$ such that $f(c) = { \int_a^b f(x)g(x)dx \over \int_a^b g(x)dx}$.

It is actually a theorem given in Tom Apostol's book Calculus Volume I: One-variable calculus, with an introduction to linear algebra, Theorem 3.16 (weighted mean-value theorem for integrals) on pg 154 to be precise and it reads as

Assume $f$ and $g$ are continuous on $[a,b]$. If $g$ never changes sign in $[a,b]$ then, for some $c$ in $[a,b]$, we have $$\int_{a}^{b}f(x)g(x)dx=f(c)\int_{a}^{b}g(x)dx.$$