I am trying to prove the following: if $f$ and $g$ are Riemann integrable on $[a,b]$, $g$ is non negative and $f$ is bounded then there exists $c$ such that $$\int_a^b f(x)g(x)dx=m\int_a^c g(x)dx+M\int_c^b g(x)dx$$
Thank you for your help.
I am trying to prove the following: if $f$ and $g$ are Riemann integrable on $[a,b]$, $g$ is non negative and $f$ is bounded then there exists $c$ such that $$\int_a^b f(x)g(x)dx=m\int_a^c g(x)dx+M\int_c^b g(x)dx$$
Thank you for your help.
Define $ h(y) := \int_a^y \left(f(x) - m \right) g(x) \, dx - \int_y^b \left( M - f(x) \right) g(x) \, dx $ on $[a,b] $.
Then $h$ is continuous and $ h(a) \le 0 $ while $ h (b) \ge 0 $. Apply the intermediate value theorem to get $c$ such that $h(c) = 0 $, simplify and conclude.
You may note that $h$ is suggested by taking the difference between the sides of the equality you have to establish.