Multiplying vectors I: the scalar (or dot) product

You will have realised by now that adding vectors is not like adding scalars (i.e. numbers), because of the directions associated with the vectors.

Similarly, multiplying vectors is not quite as straightforward as multiplying numbers. The first kind of product you can get by multiplying two vectors together is called the scalar product.

This might seem a bad choice of name, since we're multiplying vectors, not scalars! In fact the scalar product is so-called because the result of the multiplication is a scalar. So we start with two vectors, multiply them together, and end up with a scalar.

How to calculate it if the vectors are in component (i-j) form:

The quickest way to show how to calculate the scalar product of two vectors is to do an example.

Suppose we have the two vectors a and b, where a=2i+3j+4k (the old familiar one!) and b=4i-2j+k.

The scalar product of a and b is denoted a.b (hence the other name for it: the "dot product").

We calculate it by multiplying the i components together, the j components together and the k components together. (Notice the similarity with the way we added two such vectors). Then we add those three results together!

So in this case we get

a.b = (2i+3j+4k).(4i-2j+k)

= 2x4 + 3x(-2) + 4x1 = 8 - 6 + 4 = 6.

So a.b=6.

The result is a number, or scalar, as expected.

Here's another example: what is (3i-4j+5k).(-2i+j+k) ?

Answer: -6-4+5=-5.

Now that we have got some idea of the procedure, let's see the general rule. For the two vectors (ai+bj+ck) and (di+ej+fk), where a,b,c,d,e and f can be any numbers, we can form the scalar product:

(ai+bj+ck).(di+ej+fk) = ad + be + cf.

The geometric definition of the scalar product.

Any vector has a direction and a magnitude. If we have two vectors with different directions there is an angle between those vectors. This angle is usually called q (the Greek letter "theta"). The definition of the scalar product is as follows:

a.b = |a||b| cos(q),

where q is the angle between the vectors a and b, and |a| is the modulus or magnitude of the vector a.

Hold on, you say, we have had a definition of the scalar product already, it's about multiplying the corresponding components together and adding them all up.

Well the answer is, we can show that these two definitions are really the same, i.e. if we accept this definition involving cos(q) then we end up with the same result as calculating using components as we did earlier.

Recall that the unit vectors i and j and k are all at right angles to each other. So the angle between any two of them is 90o. Using the above definition, then we get that

i.j=|i||j|cos(90o).

Since the unit vectors have unit length, |i| is one, and so are |j| and |k|.

But cos(90o)=0. So we end up with

i.j=0.

In fact the same will happen if we take the dot product of any two of the unit vectors, since they will all use cos(90o).

Now what happens if we take the dot product of i with itself? The angle between i and i is obviously 0o, so

i.i = |i||i| cos(0o) = 1.

So by using a.b = |a||b| cos(q), we find that the dot product of any unit vector with itself is 1, and the dot product of any unit vector with another unit vector is zero. We can now use these results in our first example from earlier. We want to find the following dot product:

(2i+3j+4k).(4i-2j+k)

If we just multiply out the brackets, as if we were multiplying numbers, we get nine terms:

2i.4i + 2i.(-2j) + 2i.k + 3j.4i + 3j.(-2j) + 3j.k +4k.4i + 4k.(-2j) + 4k.k

Now we use our results that the dot product of a unit vector with another unit vector is zero, and that the dot product of a unit vector with itself is 1, to simplify these nine terms. Six of them involve a dot product of two unit vectors, so those six terms disappear. We are left with the three terms that involved a dot product of a unit vector with itself:

2 x 4 + 3 x (-2) + 4 x 1.

As before we get the final result of 6.

So this way of calculating the dot product is really a consequence of the definition

a.b = |a||b| cos(q).

From this definition, we can see that the scalar product of any two vectors at right angles to each other will be zero, since it will be some number multiplied by cos(90o).

Similarly the scalar product of any parallel vectors will be simply the result of multiplying their lengths together, since cos(0o)=1.

Finding the angle between two vectors:

If we are given two vectors a and b in their (i-j) component form, we can calculate their scalar product, a.b, as in the previous section. However, we also know that their scalar product is given by

a.b = |a||b| cos(q).

Can we use this equation to find the angle q?

Well, we know the components of a and b, so we can calculate their magnitudes (by squaring and adding the three components and then taking the square root, as we've done previously). So we know their dot product, and we know their magnitudes. That means we can use the equation above to find the angle between them, which we often don't know.

We rearrange the equation to get the unknown on its own, as always:

cos(q)=a.b / |a||b |

This tells us cos(q) and hence q.

Let's use this result for our earlier dot-product example. We calculated that the dot product of the vector

2i+3j+4k and the vector 4i-2j+k is 6.

If we calculate the magnitude of each of these vectors we can then use the above result to find the angle between the two vectors, which is not at all obvious!

The magnitude of 2i+3j+4k is the square root of (4+9+16), which is approximately 5.4.

The magnitude of 4i-2j+k is the square root of (16+4+1), which is approximately 4.6.

The product of these two magnitudes is approximately 24.8.

The equation above therefore gives cos(q)=6 / 24.8, which gives a q of about 76o.

So the final result is:

the angle between the vector 2i+3j+4k and the vector 4i-2j+k is about 76 degrees.