= Solution
Use the intended degree ordering from part (b). Let $\ell_j$ be the degree-$n$ Lagrange cardinal <polynomial> at the distinct <root>[roots] $x_0,\ldots,x_n$ of $p_{n+1}$:
$$
\ell_j(x)=\prod_{i\neq j}\frac{x-x_i}{x_j-x_i},\qquad
w_j=\int_a^b\ell_j(x)w(x)\,dx.
$$
For any $f\in\Pi_{2n+1}$, <polynomial division> gives $f=sp_{n+1}+r$ with $\deg s\leq n$ and $\deg r\leq n$. <Orthogonality> of $p_{n+1}$ to $\Pi_n$ makes the integral of $sp_{n+1}$ zero, and that product also vanishes at every quadrature node. Meanwhile $r=\sum_jr(x_j)\ell_j$ by interpolation. Consequently
$$
\boxed{\int_a^bf(x)w(x)\,dx=\int_a^br(x)w(x)\,dx
=\sum_{j=0}^nw_jf(x_j).}
$$
Thus the rule is exact up to degree $2n+1$. To determine the sign of a weight, apply exactness to $\ell_j^2$, of degree $2n$:
$$
\boxed{w_j=\sum_iw_i\ell_j(x_i)^2
=\int_a^b\ell_j(x)^2w(x)\,dx>0.}
$$
The inequality is strict because $\ell_j$ is a nonzero <polynomial> and the weight is positive. This is the <Gaussian quadrature> construction; the source asks only for nonnegative weights, and the proof gives positivity.
Back to article page