Skip to main content

Section8.1Dot Products and Orthogonality

Objectives
  1. Understand the relationship between the dot product, length, and distance.
  2. Understand the relationship between the dot product and orthogonality.
  3. Vocabulary: dot product, length, distance, unit vector, unit vector in the direction of x .
  4. Essential vocabulary: orthogonal.

In this chapter, it will be necessary to find the closest point on a subspace to a given point, like so:

closestpointx

The closest point has the property that the difference between the two points is orthogonal, or perpendicular, to the subspace. For this reason, we need to develop notions of orthogonality, length, and distance.

Subsection8.1.1The Dot Product

The basic construction in this section is the dot product, which measures angles between vectors and computes the length of a vector.

Definition

The dot product of two vectors x,y in Rn is

x·y=GKKIx1x2...xnHLLJ·GKKIy1y2...ynHLLJ=x1y1+x2y2+···+xnyn.

Thinking of x,y as column vectors, this is the same as xTy.

For example,

E123F·E456F=A123BE456F=1·4+2·5+3·6=32.

Notice that the dot product of two vectors is a scalar.

You can do arithmetic with dot products mostly as usual, as long as you remember you can only dot two vectors together, and that the result is a scalar.

Properties of the Dot Product

Let x,y,z be vectors in Rn and let c be a scalar.

  1. Commutativity: x·y=y·x.
  2. Distributivity with addition: (x+y)·z=x·z+y·z.
  3. Distributivity with scalar multiplication: (cx)·y=c(x·y).

The dot product of a vector with itself is an important special case:

GKKIx1x2...xnHLLJ·GKKIx1x2...xnHLLJ=x21+x22+···+x2n.

Therefore, for any vector x, we have:

  • x·x0
  • x·x=0⇐⇒x=0.

This leads to a good definition of length.

It is easy to see why this is true for vectors in R2, by the Pythagorean theorem.

O34PB32+42=534DDDDO34PDDDD=B32+42=5

For vectors in R3, one can check that AxA really is the length of x, although now this requires two applications of the Pythagorean theorem.

Note that the length of a vector is the length of the arrow; if we think in terms of points, then the length is its distance from the origin.

This says that scaling a vector by c scales its length by |c|. For example,

DDDDO68PDDDD=DDDD2O34PDDDD=2DDDDO34PDDDD=10.

Now that we have a good notion of length, we can define the distance between points in Rn. Recall that the difference between two points x,y is naturally a vector, namely, the vector yx pointing from x to y.

Definition

The distance between two points x,y in Rn is the length of the vector from x to y:

dist(x,y)=AyxA.

Vectors with length 1 are very common in applications, so we give them a name.

Definition

A unit vector is a vector x with length AxA=Bx·x=1.

The standard coordinate vectors e1,e2,e3,... are unit vectors:

Ae1A=DDDDDDE100FDDDDDD=M12+02+02=1.

For any nonzero vector x, there is a unique unit vector pointing in the same direction. It is obtained by dividing by the length of x.

This is in fact a unit vector (noting that AxA is a positive number, so CC1/AxACC=1/AxA ):

DDDDxAxADDDD=1AxAAxA=1.

Subsection8.1.2Orthogonal Vectors

In this section, we show how the dot product can be used to define orthogonality, i.e., when two vectors are perpendicular to each other.

Definition

Two vectors x,y in Rn are orthogonal or perpendicular if x·y=0.

Notation: xy means x·y=0.

Since 0·x=0 for any vector x, the zero vector is orthogonal to every vector in Rn.

We motivate the above definition using the law of cosines in R2. In our language, the law of cosines asserts that if x,y are two nonzero vectors, and if α>0 is the angle between them, then

AyxA2=AxA2+AyA22AxAAyAcosα.

xyAxAAyAAyxAα

In particular, α=90 if and only if cos(α)=0, which happens if and only if AyxA2=AxA2+AyA2. Therefore,

xandyareperpendicular⇐⇒AxA2+AyA2=AyxA2⇐⇒x·x+y·y=(yx)·(yx)⇐⇒x·x+y·y=y·y+x·x2x·y⇐⇒x·y=0.

To reiterate:

xy⇐⇒x·y=0⇐⇒AyxA2=AxA2+AyA2.