How the projection coefficient gives the projection of a vector onto a line, why the residual is perpendicular and the projection is the closest point, and how orthonormal bases and orthogonal matrices give coordinates.
Start at the point (4,3) and look at the line through the origin in the direction (1,2). Which point of the line is nearest? If you slide a candidate point along the line, the segment back to (4,3) is shortest where it meets the line at a right angle. This lesson turns that picture into a formula, proves that no other point of the line comes closer, and shows that the same measurement along unit directions gives coordinates in an orthonormal basis. A tuple such as (4,3) stands for a column vector, and the inner product is the dot product of Rn unless another one is named.
Key terms
Orthogonal list
Definition A list v1,…,vk of vectors in a real inner product space is orthogonal if ⟨vi,vj⟩=0 whenever i=j. It is orthonormal if, in addition, every vector has norm 1, that is
⟨vi,vj⟩={1,0,i=j,i=j.
An orthogonal list may contain the zero vector, while an orthonormal list cannot. An orthogonal list of nonzero vectors is linearly independent. Indeed, if c1v1+⋯+ckvk=0, taking the inner product of both sides with vj leaves cj∥vj∥2=0, so cj=0 for each j. Dividing each vector of such a list by its norm gives an orthonormal list with the same span.
In plain words In an orthogonal list every pair of vectors has inner product zero, and every pair of nonzero vectors meets at a right angle. Orthonormal adds that each vector has length one, so the list behaves like a set of standard axes.
Example In R3 the vectors v1=(1,1,0), v2=(1,−1,1) and v3=(−1,1,2) form an orthogonal list, since
Their norms are 2, 3 and 6, so v1/2, v2/3 and v3/6 form an orthonormal list. The list (1,0),(0,0) is orthogonal, but it is neither orthonormal nor independent.
Orthonormal basis
Definition An orthonormal basis of a finite-dimensional real inner product space V is an orthonormal list that is a basis of V. Since orthonormal lists are independent, every orthonormal list of dimV vectors in V is an orthonormal basis. If B=(q1,…,qn) is an orthonormal basis of V, then every v in V satisfies
v=⟨q1,v⟩q1+⋯+⟨qn,v⟩qn,
so its coordinates are [v]B=(⟨q1,v⟩,…,⟨qn,v⟩). To see this, write v=a1q1+⋯+anqn and take the inner product with qj. Every term but one vanishes, and ⟨qj,qj⟩=1, which leaves ⟨qj,v⟩=aj.
In plain words In an orthonormal basis each coordinate is a single measurement along one basis vector. No system of equations has to be solved.
Example The vectors q1=21(1,1) and q2=21(1,−1) have length 1 and dot product 0, so they form an orthonormal basis B of R2. For b=(5,−1),
q1⋅bq2⋅b=25−1=22,=25+1=32,
so [b]B=(22,32). Rebuilding gives 22q1+32q2=(2,2)+(3,−3)=(5,−1). The shortcut needs orthonormality. In the basis (1,0),(1,1), which is not orthogonal, the vector (3,2) equals 1⋅(1,0)+2⋅(1,1), so its coordinates are (1,2), while its dot products with the basis vectors are 3 and 5.
Projection onto a line
Definition Let u be a nonzero vector in Rn and L=span{u}, the line through the origin in the direction of u. The orthogonal projection of a vector b in Rn onto L is
projLb=u⋅uu⋅bu.
The scalar α=(u⋅b)/(u⋅u) is the projection coefficient. It is the only scalar for which b−αu is orthogonal to u, because the equation
u⋅(b−αu)=u⋅b−α(u⋅u)=0
has exactly one solution, since u⋅u>0 for u=0. For a unit vector q the denominator is 1, so the coefficient is q⋅b and the projection is (q⋅b)q. Replacing u by cu with c=0 divides the coefficient by c and leaves the projected vector unchanged, so the projection depends only on the line. In any real inner product space the same formula holds with ⟨u,b⟩/⟨u,u⟩ as the coefficient. If u=0, its span is {0} rather than a line, and the projection onto that subspace is 0, with no division involved.
In plain words Drop a perpendicular from b to the line, and the foot of the perpendicular is the projection. The coefficient is the signed number of copies of u that reach that foot. It can be any real number, not only a whole number, and it depends on the chosen u, while the foot does not. The denominator is the squared length of u, not its length.
Example For u=(1,2) and b=(4,3), the dot products are u⋅b=10 and u⋅u=5, so α=2 and projLb=(2,4). With −u=(−1,−2) as the generator, the coefficient is −10/5=−2, and −2⋅(−1,−2) is again (2,4). With the unit vector q=51(1,2) the coefficient is q⋅b=510=25, and 25q=(2,4) once more.
Residual vector
Definition Let u=0, L=span{u} and p=projLb. The residual vector is r=b−p. It is orthogonal to u, hence to every vector of L, and
b=p+r
writes b as a vector on L plus a vector orthogonal to L. This split is unique. If b=βu+s with s orthogonal to u, then b−βu is orthogonal to u, so β is the projection coefficient. For orthogonal vectors x and y the Pythagorean identity ∥x+y∥2=∥x∥2+∥y∥2 holds, so
∥b∥2=∥p∥2+∥r∥2.
In plain words The residual is what remains of b after removing its part along the line. When b is off the line, the residual points straight from the line to b. Its length is the distance from b to the line, as the next card proves.
Example Continuing with u=(1,2) and b=(4,3), the residual is r=(4,3)−(2,4)=(2,−1). It passes the test u⋅r=2−2=0. The squared lengths are ∥p∥2=20, ∥r∥2=5 and ∥b∥2=25=20+5. Projecting the pieces again shows their roles, since p projects to itself and r projects to 0.
Closest-point property
Definition Let u=0 in Rn, L=span{u}, b in Rn and p=projLb. For every y in L,
∥b−y∥2=∥b−p∥2+∥p−y∥2.
Hence ∥b−y∥≥∥b−p∥, with equality only for y=p. So p is the unique point of L closest to b, and the distance from b to L is the length ∥r∥ of the residual. To prove the identity, write b−y=r+(p−y). Both p and y lie on L, so p−y lies on L and is orthogonal to r. The Pythagorean identity gives the equation, and its last term is 0 only when y=p.
In plain words Moving away from the foot of the perpendicular adds a second error orthogonal to the first. Squared lengths of orthogonal errors add, so every move along the line away from the foot makes the distance larger.
Example For u=(1,2) and b=(4,3), a point of the line is y=tu, and p−y=(2−t)u. The identity becomes
∥b−tu∥2=5+5(2−t)2,
which is smallest, equal to 5, exactly at t=2. At t=0 it gives 25, the squared distance from b to the origin. At t=3 the point (3,6) gives b−y=(1,−3), with squared length 10=5+5.
Orthogonal matrix
Definition A real n×n matrix Q is orthogonal if its columns q1,…,qn form an orthonormal basis of Rn. Since the (i,j) entry of Q⊤Q is qi⋅qj, this is the same as
Q⊤Q=I.
Because Q is square, it follows that Q is invertible with Q−1=Q⊤, so QQ⊤=I as well. For the orthonormal basis B formed by its columns, coordinates are read off and rebuilt by
[b]B=Q⊤b,b=Q[b]B.
Multiplication by Q keeps dot products and lengths, since (Qx)⋅(Qy)=x⊤Q⊤Qy=x⋅y. Despite the name, the columns must be orthonormal, and orthogonal columns alone are not enough. An m×n matrix with orthonormal columns and m>n still satisfies Q⊤Q=In. But it is not square, so Q⊤ undoes it only from the left, and QQ⊤=Im. Such a matrix is not called an orthogonal matrix.
In plain words An orthogonal matrix lists a new set of perpendicular unit axes as its columns. Its transpose converts standard coordinates into coordinates along those axes, and undoing the matrix costs only a transpose.
Example The matrix
Q=51[34−43]
has columns (53,54) and (−54,53), each of length 1, with dot product −2512+2512=0, so Q⊤Q=I. For b=(5,5) the coordinates are Q⊤b=(7,−1), and indeed 7(53,54)−(−54,53)=(5,5). By contrast, the matrix M with columns (1,1) and (1,−1) has orthogonal columns, but M⊤M=2I, so it is not an orthogonal matrix. Dividing it by 2 makes it one.
Check yourself
Project b=(1,5) onto the line spanned by u=(1,1). Give the projection coefficient, the projection, the residual and the distance from b to the line.
Show the answer
The dot products are u⋅b=6 and u⋅u=2, so the coefficient is 3 and the projection is (3,3). The residual is (1,5)−(3,3)=(−2,2), and it is perpendicular to the line, since u⋅(−2,2)=0. The distance is ∥(−2,2)∥=8=22.
The vectors q1=21(1,1,0), q2=31(1,−1,1) and q3=61(−1,1,2) form an orthonormal basis B of R3. Find [b]B for b=(2,0,1) and check it by rebuilding b.
Show the answer
Each coordinate is a dot product with a basis vector,
q1⋅bq2⋅bq3⋅b=22=2,=33=3,=60=0,
so [b]B=(2,3,0). Rebuilding, 2q1=(1,1,0) and 3q2=(1,−1,1) add to (2,0,1). The third coordinate is 0 because b is orthogonal to q3. The same numbers come from Q⊤b, where Q is the orthogonal matrix with columns q1,q2,q3.
A classmate projects b=(7,1) onto the line spanned by u=(3,4) and uses the coefficient (u⋅b)/∥u∥. Find the correct projection and residual, and explain what goes wrong in the classmate’s version.
Show the answer
The dot products are u⋅b=21+4=25 and u⋅u=25, so the coefficient is 1 and the projection is (3,4). The residual (7,1)−(3,4)=(4,−3) satisfies u⋅(4,−3)=12−12=0, and the distance to the line is 5.
The classmate divides by ∥u∥=5 instead of ∥u∥2=25, gets the coefficient 5 and the point (15,20). The difference (7,1)−(15,20)=(−8,−19) has dot product −24−76=−100 with u, so it is not perpendicular to the line and (15,20) is not the closest point. The number 5 is the right coefficient for the unit vector 51(3,4), and five copies of that unit vector do give (3,4). Using it with u itself makes the answer ∥u∥ times too long.
May we count page visits to understand which courses and learning features are useful? Cloudflare collects visit and performance statistics, without your account details or answers. Your choice does not affect access. Details