Solution (source code)

= Solution

The degree-zero <polynomial> is constant and therefore even. Assume inductively that $p_j(-x)=(-1)^jp_j(x)$ for $j<k$. Define $q_k(x)=(-1)^kp_k(-x)$, which has the same leading coefficient as $p_k$.

Changing variable $x\mapsto-x$ and using the even weight and inductive hypothesis gives $\langle q_k,p_j\rangle_w=(-1)^{k+j}\langle p_k,p_j\rangle_w=0$ for $j<k$. Hence $q_k-p_k$ has degree below $k$ and is orthogonal to every $p_0,\ldots,p_{k-1}$. Those <polynomials> form a basis for the <polynomials> of degree below $k$, so the difference is orthogonal to itself. Positivity of the weighted <inner product> forces it to be zero.

Therefore
$$
\boxed{p_k(-x)=(-1)^kp_k(x),}
$$
completing the induction and proving <parity of orthogonal polynomials for an even weight>. Thus even indices give even <functions> and odd indices give odd <functions>, regardless of the nonzero normalization chosen.