# $\int_a^b f(t)g(t)dt=f(x)\int_a^b g(t)dt$

Suppose $f$ and $g$ are continuous functions on $[a,b]$ and that $g(x)\ge 0$ for all $x\in[a,b]$. Prove that there exists $x$ in $[a,b]$ such that $$\int_a^b f(t)g(t)dt=f(x)\int_a^b g(t)dt$$

I think I need to do something with this theorem:

Intermediate Value Theorem for Integrals

If $f$ is a continuous function on $[a,b]$ then for at least one $x$ in $[a,b]$ we have $$f(x)=\frac{1}{b-a} \int_a^bf$$

-

Let $m = \min \{f(x): x \in [a,b]\}$ and $M = \max \{f(x): x \in [a,b]\}$.

First let us assume that $\displaystyle \int_a^b g(x)dx > 0$. Then we have that $$m \leq \dfrac{\displaystyle \int_a^b f(x) g(x) dx}{\displaystyle \int_a^b g(x)dx} \leq M$$ Now use intermediate value theorem to get what you want.

If $\displaystyle \int_a^b g(x) dx = 0$ and since $g(x) \geq 0$ and is continuous, we have that $g(x) = 0$ on $[a,b]$. Hence, $$\displaystyle \int_a^b f(x) g(x) dx = \displaystyle \int_a^b g(x)dx =0$$ Hence, $$\displaystyle \int_a^b f(x) g(x) dx = f(t) \displaystyle \int_a^b g(x)dx$$ for any $t \in [a,b]$.

-
Note that $g(x)\geq 0$, not $g(x)>0$. –  Mario Carneiro Dec 15 '12 at 22:55
@MarioCarneiro Thanks. Have updated it. –  user17762 Dec 15 '12 at 23:14
I don't understand how you get this: $$m \leq \dfrac{\displaystyle \int_a^b f(x) g(x) dx}{\displaystyle \int_a^b g(x)dx} \leq M$$ –  Kasper Dec 15 '12 at 23:16
@Kasper since $m \leq f(x) \leq M$, we have $m g(x) \leq f(x) g(x) \leq M g(x)$ as $g(x) \geq 0$. Now integration preserves $\leq$ and $\geq$. Hence, you get I have written. –  user17762 Dec 15 '12 at 23:19
Since $g(x)\geq 0$, $f(x)g(x)\leq Mg(x)$, so $\int_a^bf(x)g(x)\,dx\leq\int_a^bMg(x)\,dx=M\int_a^bg(x)\,dx$. Thus $\dfrac{\int_a^bf(x)g(x)\,dx}{\int_a^bg(x)\,dx}\leq M$. A similar argument holds for $m$. (Edit: Ninja'd!) –  Mario Carneiro Dec 15 '12 at 23:20

Define $$\bar{f}=\frac{\int_a^bf(t)\,g(t)\,\mathrm{d}t}{\int_a^bg(t)\,\mathrm{d}t}\tag{1}$$ Then $$\int_a^b\left(f(t)-\bar{f}\right)\,g(t)\,\mathrm{d}t=0\tag{2}$$ Suppose that $f(t_+)-\bar{f}\gt0$ and $f(t)-\bar{f}\ge0$ for all $t\in[a,b]$, then $f-\bar{f}$ is positive in some neighborhood of $t^+$ and therefore $\int_a^b\left(f(t)-\bar{f}\right)\,g(t)\,\mathrm{d}t\gt0$. Thus, there must be some $t_-$ where $f(t_-)-\bar{f}\lt0$.

Suppose that $f(t_-)-\bar{f}\lt0$ and $f(t)-\bar{f}\le0$ for all $t\in[a,b]$, then $f-\bar{f}$ is negative in some neighborhood of $t_-$ and therefore $\int_a^b\left(f(t)-\bar{f}\right)\,g(t)\,\mathrm{d}t\lt0$. Thus, there must be some $t_+$ where $f(t_+)-\bar{f}\gt0$.

Thus, if $f(t)-\bar{f}$ is not identically $0$ on $[a,b]$, we must have $t_+$ and $t_-$ where $f(t_+)-\bar{f}\gt0$ and $f(t_-)-\bar{f}\lt0$.

By the intermediate value theorem, there must be an $x$ between $t_+$ and $t_-$ such that $f(x)-\bar{f}=0$, which is the same as $$\int_a^bf(t)\,g(t)\,\mathrm{d}t=\bar{f}\int_a^bg(t)\,\mathrm{d}t=f(x)\int_a^bg(t)\,\mathrm{d}t\tag{3}$$

-

Let $h(x)$ be an antiderivative of $g(x)$, so that $h'(x)=g(x)$. Then using the substitution $$u=h(t)\Rightarrow du=g(t)\,dt$$ we get $$\int_{h^{-1}(a)}^{h^{-1}(b)}f(t)\,du=f(x)\int_{h^{-1}(a)}^{h^{-1}(b)}du=f(x)(h^{-1}(b)-h^{-1}(a))$$ which we can validate using the IVT for integrals.

-
Unfortunately, this proof only works for $g(t)>0$ on $[a,b]$, or at best $g(t)=0$ at countably many points, since it relies on $h^{-1}(x)$, which may not exist if $h$ is not 1-1, since it may not be strictly increasing. Marvis' proof is more general. –  Mario Carneiro Dec 15 '12 at 23:07