[proofplan]
We define the error functional $L$, verify it vanishes on $P_{2n+1}[x]$ by the [Gaussian Quadrature Exactness Theorem](/theorems/483), and apply the [Peano Kernel Theorem](/theorems/484) with $k = 2n+1$. The Peano kernel does not change sign (due to positivity of the quadrature weights), allowing a mean value theorem simplification. The integral of $K_L$ is computed by evaluating $L$ on $x^{2n+2}/(2n+2)!$ and using the orthogonality of $Q_{n+1}$.
[/proofplan]
[step:Set up the Peano kernel and show it does not change sign]
Define $L(f) = \int_a^b w(x)\,f(x)\,d\mathcal{L}^1(x) - \sum_{i=0}^n a_i\,f(x_i)$.
By the [Gaussian Quadrature Exactness Theorem](/theorems/483), $L$ vanishes on $P_{2n+1}[x]$.
Apply the [Peano Kernel Theorem](/theorems/484) with $k = 2n+1$: $L(f) = \frac{1}{(2n+1)!}\int_a^b K_L(\theta)\,f^{(2n+2)}(\theta)\,d\mathcal{L}^1(\theta)$.
The kernel $K_L$ does not change sign on $(a,b)$ because all quadrature weights $a_i > 0$.
[/step]
[step:Compute $\int K_L$ by evaluating $L$ on a test polynomial]
Since $K_L$ does not change sign, the mean value theorem for integrals gives $L(f) = \frac{f^{(2n+2)}(\zeta)}{(2n+1)!}\int_a^b K_L(\theta)\,d\mathcal{L}^1(\theta)$ for some $\zeta \in (a,b)$.
Choose $f(x) = x^{2n+2}/(2n+2)!$ (so $f^{(2n+2)} = 1$):
\begin{align*}
\int_a^b K_L(\theta)\,d\mathcal{L}^1(\theta) &= \frac{(2n+1)!}{(2n+2)!}\left(\int_a^b w\,x^{2n+2}\,d\mathcal{L}^1 - \sum_i a_i\,x_i^{2n+2}\right).
\end{align*}
Dividing $x^{2n+2}$ by $Q_{n+1}^2$ (monic of degree $2n+2$): $x^{2n+2} = Q_{n+1}(x)^2 + r(x)$ with $r \in P_{2n+1}[x]$.
Since $L(r) = 0$ and $Q_{n+1}(x_i) = 0$: $L(x^{2n+2}) = \int_a^b w\,Q_{n+1}^2\,d\mathcal{L}^1 = \|Q_{n+1}\|_{L^2_w}^2$.
Combining: $|L(f)| \leq \frac{\|Q_{n+1}\|_{L^2_w}^2}{(2n+2)!}\,\|f^{(2n+2)}\|_\infty$.
[/step]