# The Dot Product

If and are vectors, the dot product of and is defined algebraically as

Example. (a) Compute the dot product .

(b) Compute the dot product .

(a)

(b)

The dot product of two vectors is a number. Since numbers are often referred to as scalars, the dot product is often called the scalar product.

The definition works just as well for vectors with 2 components, or more than 3 components. For example, here is the dot product of two 4-dimensional vectors:

Here are some properties of the dot product.

Theorem. Let and let .

(a)

(b)

(c)

(d)

Proof. All of these results can be proved by writing the vectors in terms of components and computing.

As an example, I'll prove (d) for 3-dimensional vectors. Suppose . Then

The dot product also has a geometric interpretation.

Theorem. Let and be vectors and let be the angle between them. Then

Note: Since , it does not matter whether is measured counterclockwise or clockwise.

Proof. Apply the Law of Cosines and use the fact that :

You can often use vectors to obtain results by computing things algebraically, then interpreting the results geometrically. In this case, you can do this because there are two ways of looking at the dot product.

For example, when will two vectors be perpendicular? This will happen if the angle between them is . In either case, , and hence .

Going the other way, if and are nonzero vectors and , then . Therefore, , so and the vectors are perpendicular.

Notes. 1. The word " orthogonal" is synonymous with "perpendicular".

2. The zero vector is trivially perpendicular to any other vector. But usually you want a nonzero vector perpendicular to another vector, and I'll try to be careful to ask for a nonzero vector.

(a) If , the angle between the vectors is acute.

(b) If , the angle between the vectors is obtuse.

Note that you can prove these geometric facts about two vectors even though it might be hard to determine them by drawing the vectors. And while we'll be primarily concerned with vectors in 2 and 3 dimensions, these facts about angles and dot products are true in n dimensions.

Example. Determine whether the vectors make an acute angle, an obtuse angle, or are perpendicular.

(a) , .

(b) ,

(a)

Since , , and the angle between the vectors is obtuse.

The vectors are perpendicular.

Example. Find the exact value of the cosine of the angle between and .

Tell whether the vectors are orthogonal; if not, tell whether the angle between them is acute or obtuse.

The angle is obtuse.

Example. Find two unit vectors which are perpendicular to . How many unit vectors are perpendicular to ?

is perpendicular to , since the two vectors have dot product 0 by inspection. , so the vectors and are unit vectors perpendicular to .

There are infinitely many unit vectors perpendicular to .

If is like a flagpole, think of vectors pointing along the ground away from the base of the flagpole. Each may be divided by its length to get a unit vector.

Algebraically, they are the unit vectors such that .

Example. Find a nonzero vector which is simultaneously orthogonal to both and .

Let be such a vector. I want

This gives the equations

Since I have two equations but three variables, I can't expect a unique solution.

I'll eliminate one of the variables to start with. The first equation gives

Substitute this into to get

At this point, I can assign a value of my choice to one of the variables. Let . Then , so . Plugging these values into , I get .

Thus, is perpendicular to and . In fact, any solution must be a multiple of the vector I found, since the vectors perpendicular to both and form a line.

Example. Find vectors , , and such that

There are lots of possibilities. For instance,

But .

The scalar component of in the direction of is

It gives the (signed) length of the "shadow" that makes on . It is positive if and point in the same direction (i.e. if the angle between them is acute) and negative if and point in the opposite direction (i.e. if the angle between them is obtuse).

To see this, consider the right triangle in the picture. The base of the triangle is , and

But

Therefore,

Example. If and , find the scalar component of in the direction of .

The vector projection of in the direction of is vector whose (signed) length is and whose direction is the direction of .

To obtain it, I multiply by the unit vector which has the same direction as . This gives

Thus, the formula is

Example. Find the vector projection of in the direction of .

Contact information