Here is the question:
Suppose $P_0, P_1, P_2, \dots$ are polynomials orthonormal with respect to the inner product $$(f,g)=\int_a^b f(x)g(x)W(x)dx,$$ where $W(x) > 0$ is a weight function and $P_n$ is of degree $n$. Is it true that $P_n$ has $n$ distinct roots in $(a,b)$?
Clearly $P_0$ has no roots and since $(P_0,P_1)=0$, I know $P_1$ must cross the $x$-axis at least once otherwise the integral would not equal $0$, so $P_1$ has one root in $(a,b)$. However, I'm not sure how to prove this for an arbitrary $n$-value (if it is true). I would appreciate any advice.
This is true. The proof I know is beautiful but quite clever in my opinion.
Because $\deg P_k = k$ for all $k$, you get $\mathbb{R}_{n-1}[X] = \textrm{Span}(P_0, \ldots, P_{n-1})$. And because of orthogonality, if $\deg f < n$ then $(f, P_{n}) = 0$.
Now, let $r_1, \ldots, r_k$ be the roots of $P_n$ that are in $[a,b]$ and have odd multiplicity (if there are some). Denote $Q = (X-r_1) \ldots (X-r_n)$, and write $P_n = Q R$. All the roots of $R$ in $[a,b]$ have even multiplicity, so $R$ does not change sign in $[a,b]$. In order to conclude, we need to show $\deg Q = \deg P_n$. If we assumed $\deg Q < \deg P_n$, then we would have
$$(Q, P_n) = 0$$
So we'd get
$$\int_a^b Q^2 R w = 0$$
But the function $Q^2 R w$ does not change sign on $[a,b]$, so $Q^2 R w= 0$. This is obviously impossible, so $\deg Q = \deg P_n$, which concludes.