advanced27 min studyLesson 312 in Mathematics

Orthogonal polynomials and projection error

Derive weighted least-squares coefficients from orthogonality and account for the discarded energy without claiming uniform optimality.

On this page

What you’ll understand

  • Construct the weighted polynomial projection from inner products.
  • Prove its best-approximation property by a Pythagorean identity.
  • Interpret coefficient tails under an explicitly stated completeness assumption.

Least-squares approximation distributes error through an integral instead of asking only for the worst point. Orthogonal polynomials make this problem almost diagonal: each coefficient can be obtained independently from one inner product. The same orthogonality gives an exact accounting of approximation energy, but it controls an integral norm and must not be mistaken for a guarantee on the largest pointwise error.

The measure determines orthogonality

Work on a finite nondegenerate interval [a,b][a,b] with an integrable weight w that is positive almost everywhere. Define the real weighted inner product by integrating the product against w. All polynomials have finite norm on this compact interval, and a nonzero polynomial has positive norm because it vanishes at only finitely many points. Applying Gram–Schmidt to the powers of x gives polynomials pkp_k of degree k that are mutually orthogonal. Their scaling remains a convention, not a mathematical necessity.

Uniform weight on [−1,1][-1,1] gives the Legendre family; the weight 1/1−x21/\sqrt{1-x^2} gives the Chebyshev family. These are different geometries, so the projection coefficients of the same function can differ. With a finite discrete sampling measure, sufficiently high polynomial degrees can become indistinguishable at the sample points; that setting needs a rank check rather than an automatic infinite orthogonal family. Here positivity almost everywhere avoids that degeneracy and makes each finite polynomial projection well defined.

⟨f,g⟩w=∫abf(x)g(x)w(x) dx,Pnf=∑k=0n⟨f,pk⟩w∥pk∥w2pk\langle f,g\rangle_w=\int_a^b f(x)g(x)w(x)\,dx,\qquad P_nf=\sum_{k=0}^{n}\frac{\langle f,p_k\rangle_w}{\|p_k\|_w^2}p_k
The formula holds for f in the weighted L² space and a mutually orthogonal polynomial basis through degree n; the basis need not be normalized.↔ Scroll wide equations horizontally.

Orthogonality proves optimality

Subtract the displayed projection from f and take its inner product with any basis polynomial through degree n. The coefficient formula makes each such inner product vanish, so the residual is orthogonal to the whole approximation space. For any competing polynomial q in that space, decompose f−q into the residual f−P_nf plus the polynomial P_nf−q. The two terms are orthogonal and their squared norms add. No competing q can improve the first term, and equality requires q to equal the projection in this positive-definite space.

This is an exact characterization, not an artifact of a particular numerical implementation. A stable algorithm still has to evaluate or estimate the integrals, handle finite precision, and represent the polynomial without unnecessary cancellation. Computing coefficients from noisy samples creates an additional statistical or quadrature problem. Conversely, even perfectly computed coefficients optimize only the selected weighted L² objective. A narrow residual spike may contribute little integrated energy and still be unacceptable under a uniform tolerance.

∥f−q∥w2=∥f−Pnf∥w2+∥Pnf−q∥w2(q∈Pn)\|f-q\|_w^2=\|f-P_nf\|_w^2+\|P_nf-q\|_w^2\qquad(q\in\mathcal P_n)
The orthogonal residual eliminates the cross term, proving uniqueness and least-squares optimality.↔ Scroll wide equations horizontally.

What the coefficient tail really says

If the orthonormal polynomials ϕk\phi_k form a complete basis of the weighted L² space and ck=⟨f,ϕk⟩wc_k=\langle f,\phi_k\rangle_w, Parseval gives residual energy equal to the sum of squared coefficients beyond n. Completeness is essential to equality with the entire infinite tail; finite orthogonality alone only gives the finite Pythagorean identities and Bessel's inequality. For the positive integrable weight on our compact interval, standard polynomial density provides the needed completeness.

Rapid coefficient decay makes low-degree compression effective, but the interpretation remains norm-specific. Differentiating a polynomial expansion weights high degrees more strongly and may amplify a tail that was small in L². Point evaluation is also not a bounded functional on general L² equivalence classes, so an L² error estimate cannot simply be read as a pointwise bound. To demand uniform accuracy or derivative accuracy, add appropriate regularity assumptions and use estimates for those stronger objectives.

Project a quadratic onto straight lines

With ordinary integration on [−1,1][-1,1], find the best degree-at-most-one L² approximant to x2x^2 and compute its squared residual norm. Compare its constant with the minimax result.

  1. The basis 1,x is orthogonal by symmetry. The coefficient of x is zero because the integral of x³ vanishes. The constant coefficient is the integral of x² divided by the integral of 1, namely (2/3)/2=1/3.

  2. Expand the squared error and integrate: ∫−11(x2−1/3)2 dx=2/5−4/9+2/9=8/45\int_{-1}^1(x^2-1/3)^2\,dx=2/5-4/9+2/9=8/45. The residual is orthogonal to both 1 and x, confirming the projection conditions.

  3. Thus the L² projection is one third, while the best uniform line from the previous lesson is one half. Neither answer contradicts the other: they minimize different objectives over the same polynomial space.

The result

The unique least-squares line is the constant one third, with squared L² error eight forty-fifths.

Explore the model

Interactive lab

Interactive lab · spectral

Orthogonal modes and discarded energy

Pause and Reset, then set mode count N = 2 and decay p = 2. Predict the coefficients are 1 and 1/4 at time zero. Reset and set both N = 3 and p = 2; the newly included coefficient is 1/9. On [0,2π], these sine modes are orthogonal, so its added squared L² energy is π/81. Compare the extra oscillation, calculating the energy on paper. This is a finite sine model, not a polynomial projection engine.

Orthogonal modes and discarded energyA finite sum of sin(nx − t)/nᵖ. Playback changes t; increasing the cutoff includes finer spatial scales. This is not a proof about a continuum limit or renormalization. Current readings: Sum at x = π/2: 0.867; Smallest wavelength: 2π / 5; Highest-mode coefficient: 0.2. All parameters are adjustable with the labeled controls below.01.573.144.716.28−2.56−1.2801.282.56x · radiansFinite sine sum
Finite sumHighest included mode
Sum at x = π/2
0.867
Smallest wavelength
2π / 5
Highest-mode coefficient
0.2
t = 0 s

A finite sum of sin(nx − t)/nᵖ. Playback changes t; increasing the cutoff includes finer spatial scales. This is not a proof about a continuum limit or renormalization. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forOrthogonality turns energy accounting into squared-coefficient accounting, but a coefficient's interpretation depends on the basis normalization.

Check your understanding

What certifies that a polynomial q is the weighted L² projection onto a finite polynomial space?

Try it yourself

Project x3x^3 onto the span of 1 and x in ordinary L² on [−1,1][-1,1]. Compute both coefficients and verify that the squared error is 8/1758/175.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Parity determines the constant coefficient. Divide the integral of x⁴ by the integral of x² for the coefficient of x, then expand the squared residual.

Compare with the solution

Oddness makes the constant coefficient zero. The coefficient of x is (2/5)/(2/3)=3/5(2/5)/(2/3)=3/5, so the projection is 3x/53x/5. The squared residual integral is ∫(x6−6x4/5+9x2/25) dx=2/7−12/25+6/25=8/175\int(x^6-6x^4/5+9x^2/25)\,dx=2/7-12/25+6/25=8/175, with all integrals over [−1,1][-1,1]. Orthogonality to x follows from 2/5−(3/5)(2/3)=02/5-(3/5)(2/3)=0; orthogonality to 1 follows from parity. These conditions certify the result without searching over all lines.

Take it with you

  • A weight chooses the inner-product geometry and therefore the projection.
  • Residual orthogonality proves the unique finite-dimensional L² optimum.
  • Coefficient-tail energy and pointwise error require different statements and assumptions.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.