Mean Value Theorem Integrals

Let $$f,g:[a,b]\to\mathbb{R}$$ be smooth and integrable. Then, there exists an $$x_0\in[a,b]$$ with

$$\int_a^b f(x)g(x)dx=f(x_0)\cdot\int_a^b g(x)dx.$$

Is there any way of approximating $$x_0$$, without evaluating $$\int_a^b f(x)g(x)dx$$?

We may assume $$g$$ to be positive and monotone increasing and $$\int_a^b g(x)dx$$ to be known.

Setting $$g(x)\equiv1$$, we obtain $$\int_a^b f(x)dx=f(x_0)\cdot(b-a),$$ so finding this $$x_0$$ numerically may be a strong tool in approximating any integral?

• Any constrained root-finding or minimisation method should work, depending on the specific functions. Apr 23, 2020 at 1:10
• @David Thanks for the idea, so just solving $\int_a^bf(x)g(x)dx-f(x_0)\int_a^b g(x)dx=0$. That would indeed work but I hoped I could approximate $x_0$ without evaluating the integral $\int_a^b f(x)g(x)dx$.
– Alex
Apr 23, 2020 at 11:05
• @Thomas I'm sorry but I think you're not being fair. The question has not changed at all! Okay, I forgot to mention continuity and you thankfully pointed that out. I am indeed grateful because it was my mistake! But the question has always been how can I find/approximate $x_0$ whose existence we know from the mean value theorem? You just pointed to a technical detail which I regrettably missed but you never answered the key question which has been there from the very beginning.
– Alex
Apr 24, 2020 at 9:17
• @mathworker21 I'm very upset that this turns into an argument. That's not what comments are for. I am very grateful to Thomas indeed!! He spotted an error an my original formulation that I acknowledged. Nonetheless, the question has always been (first version of the question): "Is there any way of finding $x_0$, at least approximately?" Okay, Thomas said it's not possible to know $x_0$. Okay, I accept (and expected) this. I however do not see how this outlines why there can't be any numerical algorithm which approximates $x_0$.
– Alex
Apr 24, 2020 at 20:34
• I have a question? why is it the case that you would like to avoid solving that integral? Is it a partial lack of knowledge of the function? If so, what data do you have on $f$? Apr 27, 2020 at 17:19

Going off Alex's comment: we are looking for $$x_0$$ such that $$f(x_0)=\frac{\int_a^b f(x)g(x)\,dx}{\int_a^b g(x)\,dx}.$$ The right hand side of the equality is the average of $$f$$ with respect to $$g$$ (or you could thing of $$g$$ as a density function for the wire starting at $$a$$ and ending at $$b$$). For example, taking $$g=1$$ as in the question, we get precisely the average value of $$f$$ on $$[a,b]:$$ $$f(x_0)= \frac{1}{b-a}\int_a^b f(x)\,dx.$$ Unfortunately, even with such a simple $$g$$, this heavily depends on choice of $$f$$. For example, pick any $$x_0$$ in $$(a,b);$$ you can find $$f$$ depending on $$x_0$$ such that $$f(x_0)$$ equals the average of $$f$$ on $$[a,b].$$ Even assuming $$f$$ is monotone increasing won't be enough: the claim of the previous sentence still holds.

I think David's suggestion of a root-finding algorithm might work (depending on $$f$$), but there may be cases it doesn't converge (like Newton's method). Note that there may be multiple solutions for $$x_0$$ and such an algorithm may oscillate between them in some way.

• You certainly got the question right! So you say there's no chance of finding $x_0$ in general, game over. The issue with the root-finding approach is that it requires me to evaluate $\int_a^b f(x)g(x)dx$, which is what I want to avoid at all cost. Indeed, that's the reason why I seek $x_0$ in the first place. I want to approximate $\int_a^b f(x)g(x)dx$ by only evaluating $\int_a^b g(x)dx$ and $f$ at $x_0$. So, I wouldn't mind (care) if there are several $x_0$ which do the job (as long as I can find at least one).
– Alex
Apr 29, 2020 at 22:01
• But you argue there's no way to approximate $x_0$? You seem to suggest that there can't be any algorithm which finds $x_0$ for a general $f$ because the problem is too difficult? I don't understand that. For a general $f$, the problem $f(x)=0$ is also difficult. Indeed, it's often impossible to solve in analytical form. Yet we have plenty of algorithms which can find zeros. So, why is my problem so much worse that there's no hope of finding $x_0$?
– Alex
Apr 29, 2020 at 22:02
• We have plenty of algorithms that can find zeroes given certain hypotheses. I didn't say your problem is worse; I said "depending on $f$"- I don't see how it's better. My guess is any root-finding algorithm that exists will work for this problem, and NONE of those methods work for ALL cases. So if you want a method that works for a specific case, then you should be more specific. There is no such algorithm that finds roots in all cases all the time. I'm not saying there is no hope for specific cases. You are trying to solve $f(x)=a$ for arbitrary $f.$ That could be extremely difficult, or not. Apr 30, 2020 at 0:21
• I didn't read the comments above, but I can easily imagine how the comments above turned into an argument, given your tone. Every sentence sounds sarcastic... By the way, $f(x_0)$ is Equal to the quotient in my answer. So even if you know $g(x)$ this problem is equivalent to finding $\int_a^b f(x)g(x)\,dx,$ which you say is too hard. Do you even know what $f$ is? If not, there are infinitely many functions for which the integral of $f\cdot g$ is equal. Apr 30, 2020 at 0:29
• I'm very sorry if you think I was rude. Very sorry indeed! I did not mean to sound unfriendly. Neither to you or anyone else here. English isn't my first language. Sorry if I said something in an unintended (!) harsh way. I know $f$. The function is merely very nasty and no analytical solution for the integral $\int_a^b f(x)g(x)dx$ exists. That's why I want to compute $f(x_0)\int_a^b g(x)dx$ instead. Thus, I seek $x_0$. You reformulated that probelm in solving $f(x)=a$, where $a=\frac{\int_a^b f(x)g(x)dx}{\int_a^b g(x)dx}$ which I however cannot solve because I don't know the numerator.
– Alex
Apr 30, 2020 at 0:43