In **two articles*, an algorithm due to Jorgen Gram and Erhard Schmidt was mentioned. Given any basis of a Euclidean vector space E, this method constructs a new basis—this time an orthonormal one—such that, at each step, the subspace spanned by the first k* vectors of the original basis is also spanned by the corresponding vectors of the new basis.
The Gram–Schmidt method constructs the orthogonal basis {L0, L1, L2, L3, …} inductively. Let's apply it to constructing Legendre polynomials from the basis {1, x, x2, x3, …, *xn*}.
Assume that the basis elements L*i have been constructed for i = 1, 2, …, n – 1, and seek Ln as the sum of the monomial xn* and a linear combination of L0, L1, …, L*n*–1. The coefficients are determined by requiring the polynomial L*n* to be orthogonal to L0, L1, …, L*n*–1.
Proceeding step by step, we obtain L0(x) = 1, L1(x) = x, L2(x) = x2 – 1 / 3 and L3(x) = x3 – 3x / 5…
Dividing these polynomials by their norms gives an orthonormal basis.