In making the definition of a vector space, we generalized the linear structure (addition and scalar multiplication) of ℝ2 an ℝ3. We ignored other important features, such as the notions of length and angle. These ideas are embedded in the concept we now investigate, inner products.
We begin with a definition.
Definition 4.1
Let V be a real (or complex) vector space. Suppose that to each pair of vectors u, v ∈ V there is assigned a real number denoted by ⟨u, v⟩. This function is called an inner product on V if it satisfies the following axioms:
(11) (Linearity in the first entry) ⟨a u1 + bu2, v⟩ = a⟨u1, v⟩ + b⟨u2, v⟩.
(12) (Symmetry) ⟨u, v⟩ = ⟨v, u⟩.
(13) (Positive definiteness) ⟨u, u⟩ ≥ 0; and ⟨u, u⟩ = 0 if and only if u = 0.
The vector space V with an inner product is called an inner product space.
Using the linearity axiom (I1) and the symmetry axiom (I2), we obtain
⟨u,av1 + bv2⟩ = ⟨av1 + bv2, u⟩ = a⟨v1, u⟩ + b⟨v2, u⟩ = a⟨u, v1⟩ + b⟨u, v2⟩.
That is, the inner product function is also linear in its second entry. By induction, we obtain
⟨a1 u1 + a2 u2 + … + ar ur, v⟩ = a1⟨u1, v⟩ + a2⟨u2, v⟩ + … + ar⟨ur, v⟩
and
⟨u, b1 v1 + b2 v2 + … + bs vs⟩ = b1⟨u, v1⟩ + b2⟨u, v2⟩ + … + bs⟨u, vs⟩.
Combining these two properties yields the following general formula:
By axiom (I3), ⟨u, u⟩ is a non negative number and hence its positive real square root exists. We use the notation
This non negative real number ∥u∥ is called the norm of u. The relation ∥u∥2 = ⟨u, u⟩ will be used frequently.
Example 4.1
Consider the vector space ℝn. The function
⟨u, v⟩ = u⊤v
defines an inner product on ℝn. Notice that this is the usual dot product u · v. The norm ∥u∥ of a vector in this space is as follows:
Although there are many ways to define an inner product on ℝn, we will often use the inner product in ℝn defined by the dot product, unless otherwise stated or implied; we will call it the usual inner product on ℝn.
Example 4.2
Let V be the vector space of real continuous functions on the interval a ≤ t ≤ b. Then the following is an inner product on V :
where f(t) and g(t) are any continuous functions on [a, b].
Another inner product on V is:
where w(t) is a given continuous function which is positive on the interval a ≤ t ≤ b. In this case w (t) is called a weight function for the inner product.
Example 4.3
Let V denote the vector space of m × n matrices over ℝ. The following is an inner product on V :
⟨A, B⟩ = Tr(B⊤A)
where Tr stands form the trace, the sum of the diagonal elements. If A = (aij) and B = (bij), then
the sum of the products of the corresponding entries. In particular,
the sum of the squares of all the elements of A.
Let V be an inner product space and let = {b1, b2, …, bn} be a basis for V. Since any vectors u, v ∈ V can be written as a linear combination of the basis using their coordinates as weights, we can write the inner product using (4.1) as follows
The n × n matrix
is called the Gram matrix if the inner product relative to the basis . Notice that by axioms (I2) and (I3), the Gram matrix must satisfy
Example 4.4
Recall that if εn is the canonical basis in ℝn, then for every vector u ∈ ℝn, we have [u]εn = u. Moreover, the usual inner product is given by ⟨u, v⟩ = u⊤v, which can be written as
So we conclude that the Gram matrix of the usual inner product with respect to the canonical basis is the identity matrix In, that is, GEn = In. This is easy to verify using the definition and is left to the reader as a straightforward exercise.
Example 4.5
Consider the usual inner product in ℝ3 and the basis = {b1, b2, b3}, where
Then,
⟨b1, b1⟩ = 1, ⟨b1, b2⟩ = 1, ⟨b1, b3⟩ = 1,
⟨b2,b2⟩=2, ⟨b2, b3⟩ = 2, ⟨b3, b3⟩ = 2.
So the Gram matrix of the usual inner product relative to is
Notice that the Gram matrix of the usual inner product in ℝ3 relative to the canonical basis is I3. In fact, the Gram matrix of an inner product is, in general, different for each choice of basis, that is, the Gram matrix of an inner product depends on the basis. This is true for any inner product space.
Example 4.6
Consider the vector space ℙ2 endowed with the inner product defined by
For the standard basis S2 = {1, t, t2}, we have
Then the Gram matrix of the inner product relative to the standard basis is
We can use the Gram matrix to compute the inner product between to elements of ℙ2. If p(t) = 1 − t and q(t) = 1 − t + t2, then
The definition of an inner product is independent of the choice of basis. Nevertheless, the Gram matrices of an inner product relative to an old basis and a new basis are, in general, not equal; that is, G ≠ G. So it is sensible to conclude that the two Gram matrices are related in some way. We explore this relation here.
First, using the Gram matrix G, we can write
Recall that for any vector x ∈ V, the coordinate vector [x] is related to the coordinate vector [x] by means of the change of basis matrix :
Therefore, we can use the change of basis matrix to change the coordinate vectors relative to the old basis to coordinate vectors relative to the new basis:
Comparing the last equation with
we conclude that
Example 4.7
Consider the usual inner product in ℝ3. Its Gram matrices relative to two different bases were computed in Example 4.4 and Example 4.5. The Gram matrix relative to the canonical basis is Gε3 = I3, where as the Gram matrix relative to the basis B given in Example 4.5 is
The matrix GB can be obtained from Gε3 = I3 by means of the change of basis matrix
Indeed, we compute
The following inequality is called the Cauchy-Schwarz inequality; it is used in many branches of mathematics.
Theorem 4.1
For any vectors u, v ∈ V,
|⟨u, v⟩| ≤ ∥u∥ ∥v∥.
This inequality is an equality if and only if one of u, v is a scalar multiple of the other.
Proof. Let u, v ε V. If v = 0, then both sides of the inequality are equal to 0 and the desired result holds. Thus we can assume that v ≠ 0.
By axiom (I3), for all λ ε ℝ, we get:
Consequently,
Taking , we obtain
That is,
Multiplying both sides by ∥v∥2,
which implies
Taking the positive square root of both sides, we finally get
Observe that if u = λ v, then
⟨u - λv, u - λv⟩ = 0.
In this case, each step of the proof is valid with ≤ and ≥ replaced with equality signs. Moreover, each step (with equality replacing inequalities) is reversible. Therefore, the Cauchy-Schwarz inequality is an equality if and only if u or v is a scalar multiple of the other.
Example 4.8
Consider any real numbers a1, …, an, b1, …, bn. Then the Cauchy-Schwarz inequality applied to the usual inner product in ℝn implies
Example 4.9
Let f and g be any real continuous functions defined on the interval a ≤ t ≤ b. Then, applying the Cauchy-Schwarz inequality to the first inner product introduced in Example 4.2, we obtain
The next theorem gives basic properties of the norm; the proof of the third property requires the Cauchy-Schwarz inequality.
Theorem 4.2
Let V be an inner product space. Then the norm in V satisfies the following properties:
(N1) ∥v∥ ≥ 0; and ∥v∥ = 0 if and only if v = 0.
(N2) ∥kv∥ = |k| ∥v∥.
(N3) (Triangle inequality) ∥u + v∥ ≤ ∥u∥ + ∥v∥; this inequality is an equality if and only if one of u, v is a non negative multiple of the other.
Proof. Property (N1) is a direct consequence of axiom (I3). Property (N2) is a direct consequence of the definition of norm and the linearity of the inner product in both entries:
Most of our effort is in proving property (N3). For u, v ∈ V,
Taking square roots of both sides of the inequality above gives the triangle inequality. The proof above shows that the triangle inequality is an equality if and only if ⟨u, v⟩ = ∥u∥ ∥v∥. If one u, v is a non negative multiple of the other, then the above equality holds. Conversely, if the above equality holds, then the condition for the Cauchy-Schwarz inequality implies that one of u, v must be a scalar multiple of the other. If u = λ v, then bye (N2), ⟨u, v⟩ = ∥u∥ ∥v∥ implies λ = |λ|, which forces the scalar in question to be non negative, as desired.
If ∥u∥ = 1, or, equivalently, if ⟨u, u⟩ = 1, then u is called a unit vector and is said to be normalized. Every non zero vector v ∈ V can be multiplied by the reciprocal of its norm to obtain a unit vector
which is a positive multiple of v. This process is called normalizing v.
The non negative real number
d(u, v) = ∥u- v∥
is called the distance between u and v. For any non zero vectors u, v ∈ V, the angle between u and v is defined to be the angle θ such that 0 ≤ θ ≤ π and
By the Cauchy-Schwartz inequality, -1 ≤ cos θ ≤ 1 and so the angle always exists and is unique.
Let V be an inner product space. The vectors u, v ∈ V are said to be orthogonal and u is said to be orthogonal to v if
⟨u, v⟩ = 0.
The relation is clearly symmetric; that is, if u is orthogonal to v, then ⟨v, u⟩ = 0 and so v is orthogonal to u. We note that 0 ∈ V is orthogonal to every vector v ∈ V for
⟨0, v⟩ = ⟨0v,v⟩ = 0⟨v, v⟩ = 0.
Conversely, if u is orthogonal to every v ∈ V, then ⟨u, u⟩ = 0 and hence u = 0 by axiom (I3). Observe that u and v are orthogonal if and only if cos θ = 0 where θ is the angle between u and v, and this is true if and only if θ = π/2.
Example 4.10
Consider an arbitrary vector u = [a1 a2 … an]⊤ in ℝn. Then a vector v = [x1 x2 … xn]⊤ is orthogonal to u if
⟨u, v⟩ = a1x1 +a2x2 + … +anxn = 0.
In other words, v is orthogonal to u if v satisfies a homogeneous equation whose coefficients are the entries of u.
Example 4.11
Suppose that we want a non zero vector which is orthogonal to v1= [1 3 5]⊤ and v2= [0 1 4]⊤ in ℝ3. Let w = [x y z]⊤. We want
0 = ⟨v1, w⟩ = x + 3y + 5z and 0 = ⟨v2, w⟩ = y + 4z.
Thus we obtain the homogeneous system
x + 3y + 5z = 0,
y + 4z = 0.
with general solution
Then, w with λ ≠ 0 is orthogonal to v1 and v2.
Let S be a subset of an inner product space V. The orthogonal complement of S, denoted by S⊥ (read “S perp”) consists of those vectors in V which are orthogonal to every vector u ∈ S:
S⊥ = {v ∈ V : ⟨v, u⟩ = 0 for every u ∈ S}.
We show that S⊥ is a subspace of V. Clearly 0 ∈ S⊥ since 0 is orthogonal to every vector in V. Now suppose that u, w ∈ S⊥. Then, for any scalars a and b and any vector u ∈ S, we have
⟨av + bw, u⟩ = a ⟨v, u⟩ + b ⟨w, u⟩ = a0 + b0 = 0.
Thus a v + b w ∈ S⊥ and therefore S⊥ is a subspace of V.
Example 4.12
Suppose we want to find a basis for the subspace S = Span{u} in ℝ3 where u = [1 3 - 4]⊤. Note that S⊥ consists of all vectors w = [x y z]⊤ such that
⟨w, u⟩ = x + 3y - 4z = 0.
The general solution of this homogeneous equation is
Therefore, a basis for S⊥ is
The next theorem is a basic result in linear algebra.
Theorem 4.3
Let S = Span{v} where v ∈ V and v ≠ 0. Then for every x ∈ V there is a unique u ∈ S and a unique w ∈ S⊥ such that
x = u + w.
Proof. Let λ be a scalar. Then
x = λv + (x - λv).
Notice that λ ∈ S. Thus we need to choose λ so that v is orthogonal to (x - λv). In other words, we want
0 = ⟨x-λv,v⟩ = ⟨x, v⟩ - λ ∥v∥2.
The equation above shows that we should choose λ to ⟨x, v⟩/∥v∥2. Making this choice of λ, we can write
Example 4.13
Consider the vectors x = [0 1]⊤ and v = [1 1]⊤ in ℝ2 with the usual inner product. Then ⟨x, v⟩ = 1, ∥v∥2 = 2, and
Then x can be written uniquely as
where ⟨v, w⟩ = 0.
Example 4.14
Consider the vector space ℙ2 endowed with the inner product defined by
Relative to the standard basis S2 = {1, t, t2}, we have the Gram matrix
If p(t) = 1 - t and q(t) = 1 - t + t2, then
and
Then
where
A set S of vectors in V is called orthogonal if each pair of vectors in S are orthogonal, and S is called orthonormal if S is orthogonal and each vector in S has unit norm. In other words, S = {u1, u2, …, ur} is orthogonal if
⟨ui, uj ⟩ = 0 for i ≠ j
and is orthonormal if
Normalizing an orthogonal set S refers to the process of multiplying each vector in S by the reciprocal of its norm in order to transform S into an orthonormal set of vectors. The following theorems apply.
Theorem 4.4
Suppose that S is an orthogonal set of non zero vectors. Then S is linearly independent.
Proof. Let S = {u1, u2, …, ur} be an orthogonal set. Suppose that the scalars a1, a2, …, ar satisfy
a1 u1 + a2 u2 + … + ar ur = 0.
Computing the inner product of both sides of the above equation with ui for i = 1, 2, …, r, by the orthogonality of S we obtain
This implies that ai = 0 for i = 1, 2, …, r is the unique solution of the homogeneous equation. Therefore S is a linearly independent set.
Theorem 4.5 Pythagoras
Suppose that S = {u, v} is an orthogonal set of two vectors. Then
∥u+v∥2= ∥u∥2 + ∥v∥2.
Proof. Suppose that ⟨u, v⟩ = 0. Then
which gives the desired result.
Example 4.15
Consider the canonical basis ε3 = {e1, e2, e3} in ℝ3 with the usual inner product. It is clear that
⟨e1,e2⟩ = ⟨e1, e2⟩ = ⟨e2,e3⟩ = 0 and ⟨e1,e1⟩ = ⟨e2,e2⟩ = ⟨e3,e3⟩ = 1.
Thus ε3 is an orthonormal basis of ℝ3. More generally, the canonical basis in ℝn with the usual inner product is orthonormal for every n.
Example 4.16
Consider the vector space ℙ2 endowed with the inner product defined by
Relative to the standard basis S2 = {1, t, t2}, we have the Gram matrix
Let S = {1, 1 - 2 t, 2 - 12t + 12t2} is an orthogonal set since
The most useful property of orthogonal bases is that the coordinates of any vector relative to an orthogonal basis can be computed directly one by one, without the need to solve a system of linear equations.
Suppose that {u1, …, un} is an orthogonal basis for V. Then, for any v ∈ V,
Theorem 4.6
Suppose that {u1, …, un} is an orthogonal basis for V. Then, for any v ε V,
Proof. Since {u1, …, un} is a basis for V, any vector v ∈ V can be written as a linear combination of the basis; that is,
v = a1u1 +a2u2 + … + anun
for suitable scalars a1, a2, …, an. Using the orthogonality of the basis, we compute
This implies that ai = ⟨v, ui⟩/⟨ui, ui⟩ for i = 1, 2, …, n, which is the desired result.
The above scalars
are called the Fourier coefficients of v with respect to {u1, …, un}.
Consider a non zero vector w in an inner product space V. For any v ∈ V, we have showed that
is the unique scalar such that = v - λ w is orthogonal to w. The projection of v along w, denoted by projwv, is defined as
The above notion is generalized as follows.
Theorem 4.7
Suppose that u1, u2, …, ur form an orthogonal set of non zero vectors in V. Let v be any vector in V. Define
v = v - (c1 u1 + c2 u2 + … + cr ur)
where
Then is orthogonal to u1, u2, …, ur.
Proof. We verify that is orthogonal to u1, u2, …, ur. For i = 1, 2, …, r, compute using the orthogonality of u1, u2, …, ur,
Therefore is orthogonal to u1, u2, …, ur.
Notice that each ci in the theorem above is the Fourier coefficient of v along the corresponding vector ui.
The notion of the projection of a vector v ∈ V along a subspace W of V is defined as follows. If W = Span{w1, w2, …, wr} where the wi form an orthogonal set, then the projection of v along W, denoted by projW v, is defined as
Suppose that {v1, v2, …, vn} is a basis of an inner product space V. One can use this to construct an orthogonal basis {w1, w2, …, wn} of V as follows. Set
In other words, for k = 2, 3, …, n, we define
By Theorem 4.7, each wk is orthogonal to the preceding w’s. Thus, {w1, w2, …, wn} forms an orthogonal basis for V as claimed. Normalizing will then yield an orthonormal basis for V.
The above construction is known as the Gram-Schmidt orthogonalization process. Each vector wk is a linear combination of vk and the preceding w’s. Hence, it can easily be shown, by induction, that each wk is a linear combination of v1, v2, …, vk. Because taking multiples of vectors does not affect orthogonality, it may be simpler in hand calculations to clear fractions in any new wk, by multiplying wk by an appropriate scalar, before obtaining the next wk+1.
Suppose u1, u2, …, ur are linearly independent, and so they form a basis for
U = Span{u1, u2, …, ur}.
Applying Gram-Schmidt orthogonalization to the u’s yields an orthogonal basis for U. The following theorems use the above algorithm and remarks.
Theorem 4.8
Suppose that S = {w1, w2, …, wr} is an orthogonal basis for a subspace W of a vector space V. Then one may extend S to an orthogonal basis for V ; that is, one may find vectors wr+1, …, wn such that {w1, w2, …, wn} is an orthogonal basis for V.
Proof. Since S is a linearly independent set in V, we can extend S to a basis of V. That is, we can find vectors ur+1, …, un such that {w1, …, wr, ur+1, … un} is a basis for V. For k = r + 1, …, n, we define
This is just the Gram-Schmidt orthogonalization process applied to {w1, …, wr, ur+1, … un}, which yields an orthogonal basis for V.
Theorem 4.9
Let W be a subspace of an inner product space V. Then each vector v ∈ V can be expressed uniquely in the form
Proof. Let {u1, …, ur} be a basis for W. Applying the Gram-Schmidt orthogonalization process, we obtain an orthogonal basis for W: S = {w1, …, wr}. Using S, for every v ∈ V, we can write
v = projW v + (v − projW v).
Clearly, projW v ∈ W. By Theorem 4.7, (v − projW v) is orthogonal to every vector in S and, thus, to every vector in W. Therefore, (v − projW v) ∈ W⊥.
Suppose that we can write
Then subtracting the above expression from v = projW v + (v − projW v), we get
Observe that (projW v − w) ∈ W and (v − projWv − ) ∈ W⊥. Therefore,
This implies that projWv − w = 0 or, equivalently, w = projW v. Similarly,
Therefore, v - projWv - w = 0 or, equivalently, w = v - projW v. This proves that each v ∈ V is expressed uniquely as v = projW v + (v - projW v).
Example 4.17
Apply the Gram-Schmidt orthogonalization process to find an orthogonal basis for the subspace U of ℝ4 spanned by
Therefore, we first set w1= v1. Then we set
Finally, compute
Multiplying the last vector by 10 to clear fractions, we set
Thus, w1, w2, w3 form an orthogonal basis for U.
Example 4.18
Let V be the vector space of polynomials with inner product
Apply the Gram-Schmidt orthogonalization process to {1, t, t2, t3} to find an orthogonal basis for P3.
Here we use the fact that, for r + s = n,
We compute
Thus, is the required orthogonal basis.
Suppose that U is a subspace of an inner product space V. Then each vector v ∈ V can be written uniquely in the form
v = u + w,
where u ∈ U and w ∈ U⊥. We use this decomposition to define a linear mapping on V, denoted by projU, called the orthogonal projection of V along U. For v ∈ V, we define projUv to be the vector u in the decomposition above.
The orthogonal projection along a subspace satisfies the following properties.
Theorem 4.10
Let U is a subspace of an inner product space V. Then,
1. range projU = U
2. ker projU = U⊥
3. v − projU v ∈ U⊥ for every v ∈ V.
4.
5. ∥projU v∥ 6 ∥v∥ for every v ∈ V.
Proof. 1. If u ∈ U, then u = projUu. Therefore, u ∈ range projU. Conversely, if u ∈ range projU, then by definition, u ∈ U. Altogether, we have U ⊆ range projU and range projU ⊆ U, which implies range projU = U.
2. If u ∈ U⊥, then it is expressed uniquely as u = 0+u since it has no component in U other than the zero vector. Then projU u = 0 which means that u ∈ ker projU. Conversely, if u ∈ ker projU then projU u = 0. But u is expressed uniquely as u = 0+w where w ∈ U⊥. It follows that u ∈ U⊥. Altogether, we have U⊥ ⊆ ker projU and ker projU ⊆ U⊥, which implies ker projU = U⊥.
3. Since v can be expressed as v = u + w where w ∈ U⊥ and, by definition, u = projU v. It follows that w = v - projU v and, thus, v - projU v ∈ U⊥.
4. Consider any vector v ∈ V. Then, by the first and second statements above, it can be written as v = projU v + w where w ∈ ker projU. Therefore, applying the orthogonal projection to both sides of this equation, we get
But this is true for any v ∈ V. Then, .
5. For every v ∈ V, by Pythagoras,
Taking the positive square root of both sides, we get .
By the definition of orthogonal projection, if U = Span{u1, u2, …, ur} where the ui form an orthogonal basis, then
The following problem often arises: given a subspace U of V and a vector v ∈ V, find a vector u ∈ U such that ∥v - u∥ is as small as possible. The next theorem shows that this minimization problem is solved by taking u = projUv.
Theorem 4.11
Suppose that U is a subspace of V and v ∈ V. Then
∥v - projU v∥ ≤ ∥v-u∥
for every u ∈ U. Furthermore, if u ∈ U and the inequality above is an equality, then u = projv.
Proof. Suppose that u ∈ U. Then
where the first equality comes from Pythagoras, which applies because (v - projU v) ∈ U⊥ and (projU v - u) ∈ U. Taking the square roots gives the desired inequality, which is an equality if and only if
This happens if and only if ∥projU v − u∥ = 0, which happens if and only if u = projv.
Example 4.19
Let V be the vector space of polynomials with inner product
Then, {1, t} is an orthogonal basis of P1. The polynomial q(t) ∈ P1 such that ∥t2k - q(t)∥ is as small as possible is
and the polynomial r(t) ∈ P1 such that ∥t2k+1 - r(t)∥ is as small as possible is
Inconsistent systems of equations A x = b arise often in applications. When a solution is demanded and none exists, the best one can do is to find an x that makes A x as close as possible to b. Think of A x as an approximation to b. The smaller the distance between b and A x, given by ∥b − A x∥, the better the approximation. The general least-squares problem is to find an x that makes ∥b − A x∥ as small as possible.
Definition 4.2
If A is m × n and b is in ℝm, a least-squares solution of A x = b is an in ℝn such that
for all x in ℝn.
The most important aspect of the least-squares problem is that no matter what x we select, the vector A x will necessarily be in the column space, Col A. So we seek an x that makes A x the closest point in Col A to b. Of course, if b happens to be in Col A, then b is A x for some x, and such an x is a “least-squares solution.”
Given A and b as above, let
where the orthogonal projection of b along Col A is defined with respect to a given inner product. Because is in the column space of A, the equation A x = is consistent, and there is an in ℝn such that
A = .
Since is the closest point in Col A to b, a vector is a least-squares solution of A x = if and only if satisfies A = , which may have many solutions if the equation has free variables.
Suppose that satisfies A = . The projection has the property that b− is orthogonal to Col A, so b − A is orthogonal to each column of A. If aj is any column of A, then ⟨aj, b−A ⟩ = 0, and , where G is the Gram matrix relative to an appropriate basis. Since is a row of A⊤,
These calculations show that each least-squares solution of A x = b satisfies the equation
This matrix equation represents a system of equations called the normal equations for A x = b.
Theorem 4.12
The set of least-squares solutions of A x = b coincides with the non empty set of solutions of the normal equations .
Proof. As shown above, the set of least-squares solutions is non empty and each least-squares solution satisfies the normal equations. Conversely, suppose that satisfies A⊤ G A = A⊤ Gb. Then satisfies A⊤ G (b - A) = 0, which shows that b - A is orthogonal to the rows of A⊤ and hence is orthogonal to the columns of A. Since the columns of A span Col A, the vector b - A is orthogonal to all of Col A. Hence the equation
b=A + (b− A)
is the decomposition of b into the sum of a vector in Col A and a vector in (Col A)⊥. By the uniqueness of the orthogonal decomposition, A must be the orthogonal projection of b along Col A. That is, Ax = b and x is a least-squares solution.
Example 4.20
Find the least-squares solution with respect to the usual inner product in ℝ2 of the inconsistent system A x = b for
In this case, we may assume that everything is expressed relative to the canonical basis, thus the Gram matrix is the identity matrix I2, so the normal equations read A⊤Ax = A⊤b. To use the normal equations, we compute:
The equation A⊤Ax = A⊤b becomes
Row operations can be used to solve this system, but since A⊤A is invertible and 2 × 2, it is probably faster to compute
and then to solve A⊤A x = A⊤b as
In many calculations A⊤A is invertible, but this is not always the case as in the following example.
Example 4.21
Find a least-squares solution relative to the usual inner product of A x = b for
As in the previous example, the Gram matrix of the inner product relative to the standard basis is the identity matrix. Compute
The augmented matrix for A⊤A x = A⊤b is
So the general least-squares solution of x = b has the form
Let V be an inner product space. A symmetric linear mapping T : V → V relative to an inner product is a linear mapping such that ⟨T (u), v⟩ = ⟨u, T (v)⟩ for all u, v ∈ V.
Theorem 4.13
Suppose that T : V → V is a symmetric linear mapping. If B = {b1, …, bn} is an orthonormal basis for V and M = (mj,k) is the matrix representation of T relative to B, then M⊤ = M.
Proof. Recall that we obtain the k-th column of M by writing T (bk) as a linear combination of the basis ; the scalars used in this linear combination then become the k-th column of M. Since is orthonormal, we know how to write T (bk) as a linear combination of :
Thus mj,k = ⟨T (bk), bj⟩. Using the symmetry of T and the symmetry of the inner product, we get
Therefore, M = (mj,k) = (mk,j) = M⊤.
One of the most important properties of symmetric linear mappings is stated in the following theorem.
Theorem 4.14
If T : V → V is a symmetric linear mapping, then any two eigenvectors from different eigenspaces are orthogonal.
Proof. Let v1 and v2 be eigenvectors that correspond to distinct eigenvalues, say, λ1 and λ2. To show that ⟨v1, v2⟩ = 0, compute
Hence (λ1 − λ2) ⟨v1, v2⟩ = 0. But λ1 − λ2 ≠ 0 so ⟨v1, v2⟩ = 0.
A linear mapping T : V → V is said to be orthogonally diagonalizable if V has an orthonormal basis consisting of eigenvectors of T. The proof of the following theorem is quite involved and is ommitted.
Theorem 4.15
Let V be an inner product space. A linear mapping T : V → V is orthogonally diagonalizable if and only if T is symmetric relative to the inner product.
This theorem is rather amazing, because the work in the previous chapter would suggest that it is usually impossible to tell when a linear mapping is diagonalizable. But this is not the case for symmetric matrices.
The next example treats a linear mapping whose eigenvalues are not all distinct.
Example 4.22
Orthogonally diagonalize the linear mapping T : ℝ3 → ℝ3 defined relative to the canonical basis by
The usual calculations produce the characteristic equation
A basis for the eigenspace associated with λ1 = 7 is
and a basis for λ2 = -2 is
Although v1 and v2 are linearly independent, they are not orthogonal. Applying the Gram-Schmidt orthogonalization process and normalization, we obtain the following orthonormal basis for the eigenspace associated with λ1:
An orthonormal basis for the eigenspace associated with λ2 :
Hence, C = {u1, u2, u3} is an orthonormal basis for R3 and the matrix representation of T relative to C is
An interesting observation is that if P = [u1… un] is a square matrix whose columns satisfy for i ≠ j and (as in the example above), then P⊤P = In. This implies that P-1 = P⊤. Moreover, it is not difficult to verify that P-1 = P⊤ if and only if the columns of P satisfy for i ≠ j and .