How do I prove this form of mean value theorem for integral? I only knew the standard mean value theorem for integrals. (i.e. $\int_a^b f(x)dx= f(c)(b-a)$ for some $c$ between $[a,b]$ where $f$ is continuous. This is directly derived by applying mean value theorem and Fundamental theorem of calculus)
I'm taking numerical analysis this year and there is one theorem stated without a proof in my text. That is:

Let $f,g$ be continuous real-valued functions on $[a,b]$ such that $g$ is nonnegative.
Then there exists some $c$ between $a,b$ such that $\int_a^b fg(x) dx = f(c) \int_a^b g(x) dx$

How do I prove this?
 A: Observe that if $g \equiv 0$, then the result holds. Thus, we'll take $g \not \equiv 0$. Since $f$ is continuous on the closed interval $[a,b]$, it must attain a minimum and maximum, so we'll say there exists $m \leq f(x) \leq M$ for all $x \in [a,b]$. Then, since $g$ is nonnegative on $[a,b]$, we have
$$ mg(x) \leq f(x)g(x) \leq Mg(x) $$
Integrating all three sides yields
$$ m \int_a^b g(x)\, dx \leq \int_a^b f(x)g(x) \, dx \leq M \int_a^b g(x) \, dx $$
Under the assumption that $g \not \equiv 0$, we may divide all three sides by $\int_a^b g(x) \, dx$, yielding
$$ m \leq \frac{\int_a^b f(x) g(x) \, dx}{\int_a^b g(x) \, dx} \leq M $$
Recalling that $f$ is continuous, we invoke the Intermediate Value Theorem to deduce that there exists $c \in [a,b]$ such that 
$$ f(c) = \frac{\int_a^b f(x) g(x) \, dx}{\int_a^b g(x) \, dx} \quad \implies \quad \int_a^b f(x) g(x) \, dx = f(c) \int_a^b g(x) \, dx$$
Therefore, the result holds. 
A: Without loss of generality assume the one-signed function $\varphi(t)\ge 0$ for all $t$ (the negative case just changes direction of some inequalities).
It follows from the extreme value theorem that the continuous function $G$ has a finite infimum $m$ and a finite supremum $M$ on the interval $[a,b]$. From the monotonicity of the integral and the fact that $m \leq  G(t) ≤ M$, it follows from the non-negativity of $\varphi(t)$ that
$$m I= \int_a^b m\varphi(t)\,dt \le \int^b_aG(t)\varphi(t) \, dt \le \int_a^b M\varphi(t)\,dt = M I,$$
where
$$I:=\int^b_a\varphi(t) \, dt$$
denotes the integral of $\varphi(t)$. Hence, if $I = 0$, then the claimed equality holds for every $x \in [a, b]$. Therefore, we may assume $I> 0$ in the following. Dividing through by $I$ we have that 
$$m \le \frac1I\int^b_aG(t)\varphi(t) \, dt\le M$$
The extreme value theorem tells us more than just that the infimum and supremum of $G$ on $[a, b]$ are finite; it tells us that both are actually attained.  Thus we can apply the intermediate value theorem, and conclude that the continuous function $G$ attains every value of the interval $[m, M]$, in particular there exists $x$ in $[a, b]$ such that
$$G(x) = \frac1I\int^b_aG(t)\varphi(t) \, dt$$
Taken directly from wikipedia with some slight code modifications. You should have googled first imo.
