The nonzero orthogonal polynomials have distinct degrees and form an orthogonal basis of . DefineFor each ,Thus the residual is orthogonal to all of .
For any , writeThe two terms are orthogonal, so the Pythagorean theorem in an inner-product space givesEquality holds only for . This proves the formula and uniqueness of the least-squares polynomial in an orthogonal-polynomial basis.
Solved by gpt-5.6-sol high.
Codex Wiki