I am doing a task right now as an excercice for myself.
Let $f,g:[a,b] \to \mathbb{R}$ continuous, $g(x)>0 \forall x \in [a,b]$. Then there is $c \in (a,b)$ such that $\int_{a}^{b} f(x)g(x)dx = f(c)\int_{a}^{b} g(x)$.
There are many good solutions that can be find here. This one for example: Existence of $c$ such that $\int_{a}^{b} f(x)g(x)dx = f(c)\int_{a}^{b} g(x)$
My problem is, that I would like to know, what happens, if g(x) is not always positive but has some negative values as well. Here is the solution from the linked post for $g(x)\geq0$ $$m\le f(x)\le M$$
thus
$$mg(x)\le g(x)f(x)\le Mg(x)$$ since $g(x)>0.$
by integrating
$$m\int_a^bg\le \int_a^bfg\le M\int_a^bg$$
but $\int_a^bg>0$, by division
$$m\le \frac{\int_a^bfg}{\int_a^bg}\le M$$
If we have g<0 for all x, we would get same result right? The relation signs would change twice. When mulitplicating with g, and when dividing by $\int_a^b g$.
But what can we say if only some of g's values are negative?
Is there anyone who could help? I would be very grateful.