Solution (source code)

= Solution

Inductively, $p_n$ is monic of degree $n$, because the leading term of $p_{n+1}$ comes only from $xp_n$. Assume $p_0,\ldots,p_n$ are mutually orthogonal. The definitions give
$$
\langle p_{n+1},p_n\rangle
=\langle xp_n,p_n\rangle-\alpha_n\langle p_n,p_n\rangle=0.
$$
Using the preceding recurrence in the form
$$
xp_{n-1}=p_n+\alpha_{n-1}p_{n-1}+\beta_{n-1}p_{n-2}
$$
gives
$$
\langle xp_n,p_{n-1}\rangle
=\langle p_n,xp_{n-1}\rangle
=\langle p_n,p_n\rangle,
$$
so $\langle p_{n+1},p_{n-1}\rangle=0$ by the definition of $\beta_n$. If $j\leq n-2$, then $xp_j$ lies in the span of $p_{j-1},p_j,p_{j+1}$, all orthogonal to $p_n$, and the remaining recurrence terms are also orthogonal to $p_j$. Hence $\langle p_{n+1},p_j\rangle=0$. Induction proves that the recurrence defines monic <orthogonal polynomials>.