The scalar, or dot product

 

We have seen now how to add together vectors and how to multiply them by scalars, but we haven’t seen how to multiply two vectors together. In fact it’s not all that obvious what it means to multiply two vectors together. A vector has a magnitude and a direction, how do you multiply directions? The answer is that there are two different ways to multiply together vectors. The first way which we will explore now is the scalar, or dot product. This will take two vectors and the product of them using this rule will give us a scalar. We definitely want something that is linear in both of the magnitudes of the vectors. That is to say that we want some way of multiplying together vectors so that when we double the magnitude of one of the vectors, we double the product. We will express the scalar or dot product of two vectors as: \vec{v}.\vec{w}. For the above property to hold, we must have that:

 

\vec{v}.\vec{w}\sim\left|\vec{v}\right|\left|\vec{w}\right|

 

but we don’t know what the constant of proportionality must be like. Clearly this already gives us a scalar and when we double one of the magnitudes, the product doubles, as we would hope for a product, but it doesn’t contain any more information than that. What we want is something that has some information also about the relative direction of the vectors. We can define a scalar product which tells us how similar the two of them are by including the angle in between the two. If the angle in between the two vectors is \theta then we can define a product like:

 

\vec{v}.\vec{w}=\left|\vec{v}\right|\left|\vec{w}\right|\cos\theta

 

Such that when the two vectors are parallel to one another the dot product is just the product of their magnitudes, and when they are orthogonal to one another, the dot product is zero. Now this contains information both about their magnitudes and about their relative directions. This product is greatest when two vectors are pointing in the same direction and reduces to zero when they are at right angles to one another. But it seems like finding the angle between two vectors isn’t going to be very easy. Is there an easier way to calculate this? We are going to use a triangle identity to find out how to calculate a dot product in component form. Given the vectors in the figure below

vec4

Three vectors forming a triangle with angle \theta in between \vec{a} and \vec{b}.

We will use the identity relating the length of the sides of a triangle and one of the angles. The sides of the triangle are of length \left|\vec{a}\right|, \left|\vec{b}\right| and \left|\vec{a}-\vec{b}\right|, thus we can write that:

 

\left|\vec{a}-\vec{b}\right|^2=\left|\vec{a}\right|^2+\left|\vec{b}\right|^2-2\left|\vec{a}\right|\left|\vec{b}\right|\cos\theta

 

If \vec{a}=\left<a_1,a_2\right> and \vec{b}=\left<b_1,b_2\right> then \vec{a}-\vec{b}=\left<a_1-b_1,a_2-b_2\right>. We know how to calculate the magnitude of a vector in component form, it’s just the pythagorean length. We can also see that the term on the right of the equation is precisely the expression we wrote above for the dot product, so let’s replace it with the dot product and see what we get:

 

\left|\vec{a}-\vec{b}\right|^2=\left|\vec{a}\right|^2+\left|\vec{b}\right|^2-2\vec{a}.\vec{b}

 

Rearranging gives:

 

\vec{a}.\vec{b}=-\frac{1}{2}\left(\left|\vec{a}-\vec{b}\right|^2-\left|\vec{a}\right|^2-\left|\vec{b}\right|^2\right)

 

Now plugging in the component forms for the right hand side we get:

 

\vec{a}.\vec{b}=-\frac{1}{2}\left((a_1-b_1)^2+(a_2-b_2)^2-(a_1^2+a_2^2)-(b_1^2+b_2^2)\right)

 

Which can be expanded out and simplifies to:

 

\vec{a}.\vec{b}=a_1b_1+a_2b_2

 

This seems to be suggesting that to calculate the dot product as we defined it above, all we have to do is to multiply together the vectors component by component. Indeed you can show that this is true in any number of dimensions. If we have two n-dimensional vectors, then the dot product of them is:

 

\vec{v}.\vec{w}=\sum_{i=1}^nv_iw_i

 

For instance: \vec{v}=\left<4,3,2,1\right>, \vec{w}=\left<1,-2,1,1\right> then \vec{v}.\vec{w}=4\times1+3\times(-2)+2\times 1+1\times 1=1. Now we also have a very easy way to find the angle in between two vectors. We know that the dot product of these two vectors is 1 and we also know that the dot product is defined as the product of the magnitudes times the cosine of the angle in between them. This means that:

 

\cos\theta=\frac{\vec{v}.\vec{w}}{\left|\vec{v}\right|\left|\vec{w}\right|}

 

which in this case gives: \cos\theta=\frac{1}{\sqrt{30}\sqrt{7}}.

We can calculate the dot product just as easily using the angle bracket notation as well as the component notation. For instance:

 

\left<-1,7,4\right>.\left<6,2,-\frac{1}{2}\right>=-6+14-2=6

 

(\vec{i}+2\vec{j}-3\vec{k}).(2\vec{j}-\vec{k})=4+3=7

 

We do this knowing that the standard basis vectors are orthogonal to one another and have magnitude one so their dot products with themselves are 1 and with the other basis vectors are 0.

The dot product is a very good way to tell whether two vectors are orthogonal to one another. For instance the fact that:

 

\left<3,6\right>.\left<4,-2\right>=12-12=0

 

Tells us that these two vectors are perpendicular to one another. Sometimes we are asked to find a unit vector perpendicular to another vector. For instance, if we want to find a unit vector perpendicular to the vector \left<4,-3\right>, then we want to find a \left<a_1,a_2\right> such that \sqrt{a_1^2+a_2^2}=1 and that \left<4,-3\right>.\left<a_1,a_2\right>=0. This is two equations and two constraints and there are two solutions to this: \left<-\frac{3}{5},-\frac{4}{5}\right> and \left<\frac{3}{5},\frac{4}{5}\right>. Note that these are two unit vectors pointing in opposite directions. These two vectors and the original vector are shown in the figure below:

vec5

The vector \left<4,-3\right> in black and the two unit vectors orthogonal to it in red and black. Remember that the placement of the vectors is irrelevant, we’ve just put them here at the origin so that it’s easier to see their lengths.

How clear is this post?