TITLE: Analyzing Integral of a product using Cauchy Mean Value Theorem?
QUESTION [6 upvotes]: Prove that if the functions $g,h:[a,b] \rightarrow \mathbb{R}$ are continuous, with $h(x) \geq 0$ for all $x\in[a,b]$, then there is a point $c$ in $(a,b)$ such that
                  $\int_a^bh(x)g(x)dx=g(c)\int_a^bh(x)dx$.
At first I tried to use the Cauchy Mean Value Theorem, by letting $A(x) =\int_a^xh(t)g(t)dt$ and $B(x) =\int_a^xh(t)dt$.  Then by CMVT, we have that there exists a point $c$ such that 
$$\frac{ \int_a^bh(x)g(x)dx }{ \int_a^bh(x)dx}= \frac{h(c)g(c)}{h(c)}=g(c) $$, and the result follows But this only holds if $h(x)$ is never $0$, which we dont have.  So is this the wrong way to do this?

REPLY [5 votes]: Use the following form of the extended mean value theorem.  If $A$ and $B$ are continuous on $[a,b]$ and have  derivatives in $(a,b)$ , then there exists $c$ between $a$ and $b$ such that
$$A'(c)[B(b)-B(a)] = B'(c)[A(b)-A(a)]$$
Proof.
Apply Rolle's Theorem to 
$$\phi(x) = [A(x)-A(a)](B(b)-B(a)]- [B(x)-B(a)](A(b)-A(a)]$$
where $\phi(a) = \phi(b) = 0$.  We get $\phi'(c) = 0$ for some c in the interval.