For which values of $k$ , does $ \int_{a}^{b}(f(x)-k)^2 dx\,$ take the minimum ? one of my friends asked me this today and I don't even know am I supposed to find a certain real number $k$ or $k$ is a function of $a$ and $b$ or even $f$ itself.
2026-04-11 11:10:33.1775905833
On
minimizing $\int_{a}^{b}(f(x)-k)^2dx$
101 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
0
On
$k$ is simply the average of $f$ over the region of integration. To see this, you can differentiate inside the integral (given that the integral exists, etc.):
$$\frac{\partial}{\partial k} \int_a^b dx \, (f(x)-k)^2 = -2 \int_a^b dx \, (f(x)-k) = 0$$
Accordingly,
$$(b-a) k = \int_a^b dx \, f(x)$$
and my assertion above follows.
It is enough to observe that $$ \begin{split} \int_a^b(f(x)-k)^2 dx & = \int_a^b (k^2 - 2k f(x) + f(x)^2)\, dx \\ & = (b-a) k^2 - 2 \left(\int_a^b f(x)\, dx\right) k + \int_a^b f(x)^2\, dx \end{split} $$ is a second order polynomial in $k$, which is minimized when $$ k = \frac{1}{b-a} \int_a^b f(x)\, dx. $$