Suppose we have a function, $\phi:[a,b]\to\mathbb{R}_{+}$. I am trying to prove that the function:
$g(\alpha)=\int^{b}_{a}(x-\alpha)^{2}\phi(x)dx$
attains its minimum value on $(a,b)$, and find the point in which it reaches that value (I believe it can be eventually expressed in terms of the function $\phi$).
The results I've obtained so far are not very promising. First off, the only way that I know to prove the thesis is by finding an $\alpha_{0}$, such that $g^{\prime}(\alpha_{0})=0$ and then show that $g^{\prime\prime}(\alpha_{0})\geq{0}$.
As for the first part, let's define a bivariate function: $h(\alpha,x)=(x-\alpha)^{2}\phi(x)$. We have:
$g^{\prime}(\alpha)=\int^{b}_{a}\frac{\partial}{\partial\alpha}h(\alpha,x)\,dx=-2\int^{b}_{a}x\phi(x)\,dx+2\alpha\int^{b}_{a}\phi(x)\,dx.$
I have no idea how to deal with the expression $\int^{b}_{a}x\phi(x)\,dx$. Is there a way we can somehow evaluate it and transform into a more elementary form? If not, then by equating the result we obtained to $0$, we arrive at:
$\alpha=\frac{\int^{b}_{a}x\phi(x)\,dx}{\int^{b}_{a}\phi(x)\,dx}$
How can we interpret the above expression, or at least prove that it belongs to the interval $(a,b)$? I would be very thankful on some ideas as to where I should head with this.
EDIT: we also assume that $\phi$ is continuous.