Show that $\int_a^bfg\, dx=f(c)\int_a ^bg\, dx $ for some $c$ if $g>0$ Let $f, g:[a,b]  \to \mathbb{R}$ be continuous functions on $[a,b]$. If $g(x)>0$ for all $x\in [a,b]$, then there exists a $c \in [a,b]$ such that 
$$\int_a^bfg\, dx=f(c)\int_a ^bg\, dx. $$
How can one prove this?

Let $I = \int_a^b g(x) \, \mathrm{d}x$ and since $f$ is continuous on a closed interval, $f$ is bounded and attains it's bounds, say $m \leq f \leq M$ on $[a,b]$, then since $g > 0$ we get $$mI \leq \int_a^b fg \, \mathrm{d}x \leq MI.$$
If $I=0$ we are done, if not  $m \leq \frac{1}{I}\int_a^b fg \, \mathrm{d}x \leq M$. But by the intermediate value theorem we know that $f$ attains every value of $[m,M]$. So for some $c \in [a,b]$ we have $$f(c) = \frac{1}{I}\int_a^b fg \, \mathrm{d}x \implies \int_a^b fg \, \mathrm{d}x = f(c)I = f(c) \int_a^b g \, \mathrm{d}x$$
and we are done. 
