Skip to main content

Section7.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:

closestpoint x

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.

Subsection7.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 R n is

x · y = GKKI x 1 x 2 ... x n HLLJ · GKKI y 1 y 2 ... y n HLLJ = x 1 y 1 + x 2 y 2 + ··· + x n y n .

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

For example,

E 123 F · E 456 F = A 123 BE 456 F = 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 R n 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:

GKKI x 1 x 2 ... x n HLLJ · GKKI x 1 x 2 ... x n HLLJ = x 21 + x 22 + ··· + x 2 n .

Therefore, for any vector x , we have:

  • x · x 0
  • 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 R 2 , by the Pythagorean theorem.

O 34 P B 3 2 + 4 2 = 5 3 4 DDDDO 34 PDDDD = B 3 2 + 4 2 = 5

For vectors in R 3 , one can check that A x A 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,

DDDDO 68 PDDDD = DDDD 2 O 34 PDDDD = 2 DDDDO 34 PDDDD = 10.

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

Definition

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

dist ( x , y )= A y x A .

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 A x A = B x · x = 1.

The standard coordinate vectors e 1 , e 2 , e 3 ,... are unit vectors:

A e 1 A = DDDDDDE 100 FDDDDDD = M 1 2 + 0 2 + 0 2 = 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 A x A is a positive number, so CC 1 / A x A CC = 1 / A x A ):

DDDD x A x A DDDD = 1 A x AA x A = 1.

Subsection7.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 R n are orthogonal or perpendicular if x · y = 0.

Notation: x y means x · y = 0.

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

We motivate the above definition using the law of cosines in R 2 . 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

A y x A 2 = A x A 2 + A y A 2 2 A x AA y A cos α .

x y A x A A y A A y x A α

In particular, α = 90 if and only if cos ( α )= 0, which happens if and only if A y x A 2 = A x A 2 + A y A 2 . Therefore,

x and y areperpendicular ⇐⇒A x A 2 + A y A 2 = A y x A 2 ⇐⇒ x · x + y · y =( y x ) · ( y x ) ⇐⇒ x · x + y · y = y · y + x · x 2 x · y ⇐⇒ x · y = 0.

To reiterate:

x y ⇐⇒ x · y = 0 ⇐⇒A y x A 2 = A x A 2 + A y A 2 .