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.






if and only if

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,

and the function c f is given by
Define the dot product on C[a, b] by

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

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

Let t be any real number and notice that




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
Proof:



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


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

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

Proof:
We want to choose t to minimize the function




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.
(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].
f(t) = sin t g(t) = cos t
in C[-pi, pi] perpendicular? answer
f(t) = sin t g(t) = sin 2t
in C[-pi, pi] perpendicular? answer