The dot product is an important operation between vectors that captures geometric information.
We have already seen how to add vectors and how to multiply vectors by scalars. As it turns out, there is not a single useful way to define “multiplication” of vectors, but there are several types of products defined for two vectors that have intrinsic meaning. One such example is the dot product, which we motivate using the example below.
A person is trying to drag a table from one side of a room to the other across a carpeted floor. While moving, the table is dragged only, not lifted. In order to cause the table to move, the person applies a force, which is directed along the person’s arms. We can consider two scenarios - one in which the force applied is mostly in the direction that the table moves, and one in which only a small part of the force is in the direction of motion.
Since there is frictional force to overcome in order to move the table, work is done when the table is moved. The person trying to move the table will notice that much more force is necessary to apply in the scenario when less of the applied force is in the direction of motion. In fact, a result from physics ensures that the work done is given by
By denoting the force by and the displacement vector by , and letting be the angle between them, we note that the component of in the direction of motion is , so
Let’s now return to our original scenarios. The same amount of work in both scenarios is done when dragging the table across the room and in both scenarios, the angle lies between and . Letting be the angle in the first scenario and be the angle in the second one, note . Letting and be the force required to apply in each scenario, we now have
The above scenario illustrates a quantity that is fundamentally important in physics, but it is useful in other instances as well. We can extract the mathematical essence of the above example as follows.
Given two vectors and , the quantity is important.
Since this quantity is important, we dignify it with a definition.
Let and be nonzero vectors and let be the angle between them. We define the dot product of and , denoted by by
In the instance when one of the vectors is , we define .
Given the magnitude and angles made by two vectors in , it is straightforward to compute, but we want to work vectors in higher dimensions, and we therefore want to find a quick way to compute this quantity using the components of and . Thankfully, there’s a good way to do this.
Suppose that and are vectors in . We define the dot product of and , denoted by by
That is, to compute the dot product, we multiply the corresponding components together and add them, and we do this for as many components as we have.
While this may seem intimidating at first, we usually have in mind that or , and we can unpack the formula in these cases.
- In , we have .
- In , we have .
Some texts start with the above theorem as the definition of the dot product, and show that our definition can be derived from it. What is really important is that we have two equivalent ways to express the dot product. Both can be useful, as we will see in many examples to follow.
It might (and likely should) be entirely unclear at this point why the above definition and theorem are consistent with each other. The appendix to this section establishes this in more detail, but here’s an example that demonstrates their equivalence in the context of a specific pair of vectors.
- The magnitude-angle definition requires that we find the angle between
the two vectors. Since makes an angle of with the positive -axis, and
makes an angle of with the positive -axis, we find that
- The component definition requires that we find the
components , , , and . We can use trigonometry to find and .
Similarly, we find and .
We now have that
Both methods agree in the context of this example.
We have two different ways to find dot products. We can now make several observations about this type of product between vectors and explore some applications.
While it may be easy to miss, notice that in both definitions, the dot product is defined between two vectors of the same dimension (this is most readily visible in the component description of the dot product, which requires that we pair each component in with one in ). In both definitions, when we compute the dot product, the result is a scalar.
The dot product is defined for vectors with the same dimension. When it is defined,
The dot product allows us to write some complicated formulas more simply.
Note that the notion of defining an angle in a general context in (or higher dimensions) is problematic, but the angle between two vectors does make sense. For instance, we can imagine laying a protractor on two vectors in and aligning one end with one of the vectors. We can then measure the angle formed between them.
While actually figuring out how to compute this might seem daunting, the two definitions of the dot product allow us to find this angle without too much work.
One remark is in order; we take by convention that the angle between two vectors be between and , inclusive. Since the range of is , the the angle found above must be the correct angle.
Note that the logic in the above example can be generalized to produce a formula for the angle, which is listed below. Although there is a formula, the logic required to obtain it is contained in the previous example. It is therefore recommended that you are able to reproduce the logic, and not just memorize the formula.
Given two nonzero vectors in or , we say that the vectors are perpendicular if the angle between them is a right angle. Since we can use the dot product to capture information about the angle between vectors, it should not be surprising that it can be used to find perpendicular vectors.
- We must show if , then must be .
- We must show if , then must be .
To show the first part, assume that note that . We must show that must be . By using the magnitude-angle formulation of the dot product, note that since , we must have that . Since and are nonzero, their magnitudes are not , so we must have that , and hence .
To show the second result, assume that . We must show that must be . Since , we have that , and using the magnitude-angle formulation
This allows us to define and generalize our notion of “perpendicularity” when it is more difficult to visualize, and we introduce a special buzz-word to do so.
A subtle point that could be overlooked easily here is that given our definition, the zero vector in is orthogonal to every vector in . While our notion of “perpendicularity” required us to think of the angle between vectors, this is not a well-defined concept when we discuss the zero vector. however, both formulations of the dot product allow us to handle the zero vector.
We summarize the arithmetic and algebraic properties of the dot product below.
- Linear in first argument:
- Linear in second argument:
- Relation to magnitude:
- Relation to orthogonality:
- Let denote the vector whose -th component is , and whose other components are . Then,
Note that the item “Notion of Orthogonality” might sound formal here, but if we are working in ,
The condition will require that we take and and tells us the following.
Note that this precisely agrees with our intuition that the unit vectors that are parallel to the , , and axes are orthogonal to each other.
As an interesting remark, instead of defining the dot product by a formula, we could have defined it by the properties above, and we could actually derive the formula from these! While this is common practice in mathematics, the process is a bit abstract and is better left as the subject of a more advanced course.