I am starting to study some concepts related to orthogonal polynomials and my teacher told me to prove the following theorem,
Theorem The integral $\int_{a}^{b} Q_n^2(x)w(x) dx$ where $Q_n(x)$ is any monic polynomial of degree $n$, takes its minimum value when $Q_n(x)=P_n(x)$, where $P_n$ is a polynomial of degree $n$ associated to a weight function $w(x)$ such that $\{P_n\}$ is an orthogonal sequence associated to $w(x)$.
My first idea was to maybe use the Least-squares function approximation that my teacher has in the slides, that says the following: The integral $\int_{a}^{b} |f(x)-p(x)|^2w(x) dx$ takes the minimum value when $p(x)=a_0p_0(x)+...+a_n p_n(x)$ where $a_m= \int_a^bf(x)p_n(x)w(x) dx$.
So, i thought of the following approach: If I take $p(x)$ to be $Q_n(x)$ in the Least-squares function approximation i presented above, i would see that when i calculate the $a_m$ coefficients all of them would be zero except for $a_n$ which i would then have to verify to be 1 and then we would have that $Q_n(x)=P_n(x)$.
Is my thought process correct? Or am I doing something wrong?
Thanks for any help in advance!