Mathematical Structure
The Dot Product


Prerequisites:


This module is a companion module for the module on Magnitude or Length. In many vector spaces but not all vector spaces we can talk about geometric ideas like length and angles. The algebraic idea that enables us to do this has three names -- the dot product, the inner product, and the scalar product. These three names are all synonyms -- they mean exactly the same thing. Whatever it is called, the dot product is intimately bound up with the idea of length or magnitude.

As usual this idea is most easily seen in R2. We developed the idea of the dot product in R2 in the module Looking at a 3D World with 2D Eyes. In that module we came up with two formulas for the dot product.

Missing equation

where theta is the angle from x to y measured counterclockwise as shown in the figure below.

Missing figure

We can generalize the first, algebraic, definition to the vector spaces Rn by --

Missing equation

Because we want to be able to use the dot product to carry geometric ideas and tools over to situations where the geometry is not immediately evident, we want to study the dot product algebraically and then use it motivated by the connection between the algebra and the geometry in R2 that is evident from the equation

Missing equation

First notice that

Missing equation

and

Missing equation

if and only if

Missing equation

so we see that the idea of the dot product is closely tied up with the idea of length or magnitude. It is easy to show that the dot product we have defined for Rn has the following properties, called the dot product properties.

For any vectors x, y, and z in Rn and any real number c,

Missing equation

Any vector space with an operation, called the dot product, inner product, or scalar product, that has these properties is called an inner product space.


Let C[a, b] denote the set of all continuous functions on the interval [a, b]. Define the usual two vector space operations on this set of functions. That is, if f and g are two functions in C[a, b] and c is a real number then the function f + g is given by

(f + g)(t) = f(t) + g(t)

and the function c f is given by

(c f)(t) = c f(t).

Define the dot product on C[a, b] by

Missing equation

Prove that C[a, b] with this operation is an inner product space -- that is, prove that this operation satisfies the dot product properties.


Definition:

In any inner product space we can define the magnitude of a vector, v by

Missing equation


Check that this definition of magnitude agrees with the definitions we gave for all vector spaces discussed in the module on magnitude.


One of the most amazing facts in mathematics is that the short list of purely algebraic properties -- the vector space properties and the inner product space properties -- shared by all inner product spaces are all we need to do geometry even in exotic spaces like C[a, b] where the idea of the length of a function or the angle between two functions is far from intuitively evident. The following theorem is one key to doing geometry in inner product spaces.

Theorem (The Cauchy-Schwartz Inequality):

If x and y are vectors in an inner product space then

Missing equation

Proof:

Let t be any real number and notice that

Missing equation

Since the left side of this equation is nonnegative we have

Missing equation

Think of the left hand side of this inequality as a quadratic function in the variable t. For a quadratic function

MIssing equation

to be nonnegative the quantity

Missing equation

cannot be positive. Thus,

Missing equation

which completes the proof of the Cauchy-Schwartz Inequality.

This proof is very disappointing. It is perfectly correct and it is the standard proof but it gives absolutely no insight into why the Cauchy-Schwartz Inequality is true.

With the Cauchy-Schwartz Inequality in hand we can prove another important fact.

Theorem (The Triangle Inequality):

If u and v are two vectors in an inner product space then

||u + v|| <= ||u|| + ||v||

Proof:

Missing equation

These two inequalities provide reassuring evidence that these algebraic constructions -- the dot product and the magnitude -- will enable us to apply geometric ideas in any inner product space. Recall that in R2 we had

Missing equation

In this vector space the Cauchy-Schwartz Inequality is immediately evident because |cos theta| <= 1. But now we have seen that the same inequality holds for purely algebraic reasons in any inner product space. This allows us to determine the angle between two vectors u and v in any inner product space by

Missing equation

Note that there is some ambiguity here -- because

cos theta = cos (-theta)

we can determine the absolute value of theta but not its sign. The reason for this ambiguity is apparent in R3. If you look at two vectors u and v in R3 then it is impossible to determine whether v is clockwise from u or counterclockwise.

In particular, notice that vectors u and v in an inner product space are perpendicular or orthogonal if

Missing equation

We use the notation

Missing equation

to indicate that two vectors are perpendicular.

The triangle inequality tells us that our new notion of magnitude and the corresponding notion of distance defined from magnitude behaves as we would expect --

Theorem:

If x, y, and z are vectors in an inner product space then

||x - z|| <= ||x - y|| + ||y - z||

Proof:

This theorem follows immediately from the triangle inequality with u = x - y and v = y - z.

The inequality in this theorem is often called the triangle inequality because it is an immediate consequence of the original triangle inequality and because it says that the direct distance between two vertices x and z of a triangle is less than or equal to the distance by way of the third vertex, y. See the figure below.



The next theorem is another key to the power of the dot product. Like our earlier theorems it shows that this algebraic construction does the same job in any inner product space that it did in R2.

Theorem:

Suppose that u and v are two vectors in an inner product space. Then the closest vector of the form tv to u is given by

Missing equation

Proof:

We want to choose t to minimize the function

Missing equation

or, equivalently, the function

Missing equation

We proceed in the usual way by looking for critical points.

Missing equation

Missing equation

which is the formula that we sought.

You should use one of the computer algebra systems below with the following exercises. Click on the appropriate icon for your preferred CAS and then arrange your screen so that you can easily move back-and-forth between this window and your CAS window. Click on the appropriate help button for help.

Maple worksheet Mathematica notebook TI-92 Browser Window

Help Help Help


  1. Find the length of the vector (1, 2, 3, 4). answer

  2. Find the angle between the two vectors (1, 2, 3, 4) and (3, 1, 4, 6). answer

  3. Describe the triangle whose three vertices are at the points

    (1, 3, 2, 4), (3, 1, -2, 4), and (4, 4, -1, -1)

    as completely as possible. answer

    Recall our work above with the inner product spaces C[a, b].

  4. Are the two vectors

     
    f(t) = sin t
    g(t) = cos t
    

    in C[-pi, pi] perpendicular? answer

  5. Are the two vectors

     
    f(t) = sin t
    g(t) = sin 2t
    

    in C[-pi, pi] perpendicular? answer

  6. Find the closest function of the form f(t) = c t to the function g(t) = sin t on the interval [-pi/2, pi/2]. answer

  7. Find the closest function of the form f(t) = c t to the function g(t) = sin t on the interval [-pi, pi]. answer

  8. Find the closest function of the form f(t) = c sin t to the function g(t) = sin(t + pi/3) on the interval [0, 2 pi]. answer

  9. Find the closest function of the form f(t) = c sin t to the function g(t) = sin(t + pi/3) on the interval [0, 4 pi]. answer

  10. Find the closest function of the form f(t) = c cos t to the function g(t) = sin(t + pi/3) on the interval [0, 2 pi]. answer


Copyright c 1995 by Frank Wattenberg, Department of Mathematics, Montana State University, Bozeman, MT 59717