Integral Mean Value Theorem: Open Interval

calculusdefinite integralsintegrationproof-explanation

I'll start off by saying that I've found about 3 other questions very similar to this one around here, but none of them seem to have gotten to the heart of the issue. I'll append links to this post as proof that I did research before posting.

Wikipedia, as well as many other sources including several here on StackExchange, claim that:
"In general, if $f:[a, b]\longrightarrow \mathbb{R}$ is continuous and $g$ is an integrable function that does not change sign on $[a, b]$, then there exists $c \in (a, b)$ such that $\int_a^bf(x)g(x)dx=f(c)\int_a^bg(x)dx$." (This is a quote from Wikipedia.)

I had managed to prove this using the "normal" intermediate value theorem for real continuous functions, but this gives me a $c$ in the closed interval $[a,b]$, instead. That's a significant difference because if it so happens that $c=a$ and that's the only appropriate $c$, then there in fact isn't a $c\in(a,b)$ such that the above is true. The Wikipedia page, right after claiming that such a $c$ exists in the open interval, goes on to prove that it exists in the closed interval, instead (in the manner I just described, using the IVT).

I tried, instead, to prove it using Lagrange's Mean Value Theorem, and that worked for the case in which $g=1$: let $f:[a,b]\longrightarrow\mathbb{R}$ be continuous in its domain, and let $F:[a,b]\longrightarrow\mathbb{R}$ be $\int_{a}^{x}f(x)dx$; so, according to the FTC, $F$ is differentiable in $[a,b]$ and $F'=f$ there; so the conditions for the Mean Value Theorem are fulfilled and we get:

$$\exists c \in (a,b): \frac{\int_a^b f(x)dx}{b-a}=\frac{F(b)-F(a)}{b-a}=F'(c)=f(c)$$

Which gives the result.
But for the case in which $g$ is a general function that doesn't change its sign and not specifically $1$, I'm not really sure how to proceed. Everything I try leaves me with some unwated terms on one side of the equation or the other.

I also ended up in this Wolfram MathWorld page:
https://mathworld.wolfram.com/LagrangeRemainder.html
enter image description here

Which seems to me to be essentially the same thing I've been trying to do but with $g(t)=(x-t)^n$. However, they just skip the explanation in (3) which is what I'm after. When I tried it, I ended up with "$c$"s ($x^*$) and "$a$"s ($x_0$) in places they shouldn't be.

I'm assuming this is a lot simpler than I make it out to be, but for some reason I just fail to make it work right now. Would really appreciate some help.

Links to similar questions:
Mean value theorems for integrals on an open interval
Generalized Mean Value Theorem for integrals (in $\mathbb{R}$) with $c$ in the open interval $(a,b)$.
Source of the Wikipedia quote:
https://en.wikipedia.org/wiki/Mean_value_theorem#Mean_value_theorems_for_definite_integrals

Best Answer

Consider the non-trivial case where $\int_a^bg(x) \, dx \neq 0$ and let $q = \int_a^bf(x) g(x) \, dx \, / \, \int_a^b g(x)\, dx$. Let $m = \inf_{x \in [a,b]}f(x)$ and $M = \sup_{x \in [a,b]}f(x)$. There are three cases to consider. In all cases we find $c \in (a,b)$ such that $f(c) = q$ and $\int_a^b f(x) g(x) \, dx = f(c) \int_a^b g(x) \, dx.$

Case 1: Suppose $m < q < M$. By properties of the infimum and supremum, there exists $a < \alpha < \beta < b$ such that

$$m < f(\alpha) < q < f(\beta) < M \quad \text{or}\quad m < f(\beta) < q < f(\alpha) < M$$

Since $f$ is continuous there exists by the intermediate value property $c \in [\alpha,\beta] \subset (a,b)$ such that

$$f(c) = q = \frac{\int_a^b f(x) g(x) \, dx}{\int_a^b g(x) \, dx}$$

Case 2: Suppose $q = m$ and assume without loss of generality that $g(x) \geqslant 0$. Since $f(x) \geqslant m$, we have

$$\int_a^b |f(x) - m| \, g(x) \, dx = \int_a^b (f(x) - m) \, g(x) \, dx = (q -m) \int_a^b g(x) \, dx = 0,$$

and it follows that $(f(x) - m) \, g(x) = 0$ almost everywhere. In this case where $\int_a^b g(x) \, dx > 0$ we have $g(x) > 0$ almost everywhere and there must be a point $c \in (a,b)$ such that $f(c) = m$.

In Case 3 we have $q = M$ and the proof is similar to Case 2.

Related Question