Gram-Schmidt orthonormalization, also called the Gram-Schmidt process, constructs an orthonormal basis for the span of a linearly independent family in an inner product space, preserving the successive spans. Omitting the normalization steps gives Gram-Schmidt orthogonalization.
For vectors ,
, ... in a real or complex inner
product space, the construction is
|
(1)
| |||
|
(2)
|
where
and the sum is empty for
. Here
denotes the given inner
product, taken to be linear in its first argument and antilinear
in its second, and
is its induced norm.
The linear independence of the input vectors
ensures that every residual
is nonzero, so the normalization
is defined (Axler 2024, pp. 183-184 and 201). In the Wolfram
Language, Orthogonalize[
v0,
v1, ...
] gives an orthonormal basis
for a linearly independent list of vectors.
For the real functions considered below, use the weighted inner product
|
(3)
|
The nonnegative weight must make this inner product
positive definite on the function space under consideration,
and all required integrals must be finite. All subsequent integrals are over the
same interval
.
Applying the Gram-Schmidt process to the functions 1, ,
,
... on the interval
with the usual
inner product gives the
Legendre polynomials (up to constant multiples;
Reed and Simon 1972, p. 47).
Given an original set of linearly independent functions , let
denote the orthogonalized (but not normalized)
functions,
denote the orthonormalized functions,
and define
|
(4)
| |||
|
(5)
|
Then take
|
(6)
|
where we require
|
(7)
| |||
|
(8)
|
By definition,
|
(9)
|
so
|
(10)
|
The first orthogonalized function is therefore
|
(11)
|
and the corresponding normalized function is
|
(12)
|
By mathematical induction, it follows that
|
(13)
|
where
|
(14)
|
and
|
(15)
|
If the functions are normalized to positive instead of 1, then
|
(16)
|
|
(17)
|
|
(18)
|
Orthogonal polynomials are especially easy to generate using the Gram-Schmidt process applied to 1, ,
, ..., provided all required moments
are finite. In particular,
|
(19)
|
Choose monic polynomials of degree
, starting with
|
(20)
| |||
|
(21)
|
As defined, and
are orthogonal polynomials,
as can be seen from
|
(22)
| |||
|
(23)
|
Now use the recurrence relation
|
(24)
|
for
to construct the remaining monic polynomials.
To verify orthogonality, suppose , ...,
are mutually orthogonal,
and write the two coefficients in the recurrence
relation as
and
. Then
|
(25)
|
For ,
all three terms vanish because
has degree at most
.
For
,
the polynomial
also has degree
at most
, so
|
(26)
|
This cancels the term containing . For
, the first two terms cancel by the definition of
, and the last term is zero. Thus
is orthogonal to every
preceding polynomial, completing the induction.
Many common orthogonal polynomials of mathematical physics can be generated in this manner. In finite-precision arithmetic, the classical process can lose orthogonality (Golub and Van Loan 1996).