Section 6 Vector Operations
¶Now that you have the basic idea of what a vector is, we'll look at operations that can be done with vectors. As you learn these operations, one thing to pay careful attention to is what types of objects (vector or scalar) each operation applies to and what type of object each operation produces.
Subsection 6.1 Scalar multiplication
The first key operation is scalar multiplication, multiplying a scalar and a vector. If \(k\) is a scalar and \(\vec{v}\) is a vector, their product \(k\vec{v}\) is defined as follows:
If \(k > 0
\text{,}\) then \(k \vec{v}\) is the vector pointing in the same direction as \(\vec{v}\) that's \(k\) times as long as \(\vec{v}\text{.}\)
If \(k = 0\text{,}\) then \(k \vec{v}\) is \(\vec{0}\text{.}\)
If \(k < 0
\text{,}\) then \(k \vec{v}\) is the vector pointing in the opposite direction from \(\vec{v}\) that's \(|k|\) times as long as \(\vec{v}\text{.}\)
For example, if \(\vec{v}\) is the vector shown at left below, here's how you'd picture \(2 \vec{v}\) and \(-0.6 \vec{v}\text{:}\)
Note that the picture above could be happening in \(\R^2\) or \(\R^3\text{.}\) 1
From the pictures above, it shouldn't surprise you that we say that two vectors are parallel if one of them is a scalar multiple of the other. So, the three vectors above are all parallel to each other.
Subsection 6.2 Vector addition
The second key operation is vector addition, adding one vector to another. Here's how this is defined: if we have two vectors \(\vec{v}\) and \(\vec{w}\) in \(\R^n\text{,}\) 2 draw \(\vec{v}\) (with its tail anywhere), and then draw \(\vec{w}\) with its tail at the head of \(\vec{v}\text{.}\) Then, \(\vec{v} + \vec{w}\) is defined to be the vector that goes from the tail of \(\vec{v}\) to the head of \(\vec{w}\text{.}\)
Subsection 6.3 The dot product
Imagine that you've installed a solar panel. As the sun moves through the sky, the angle between the sun's rays and the solar panel changes. It's ideal if the sunlight hits the solar panel at a \(90^\circ\) angle; the solar panel can capture the most energy this way. On the other hand, if the sunlight happens to be parallel to the panel, the panel can't get any energy from the sunlight. In this example (and many others), the angle between two objects is important. The dot product is an operation on vectors that enables us to easily find the angle between two vectors.
First, it's important to understand that, when we talk about the angle between two vectors, we're picturing the vectors with their tails at the same point. So, for the vectors \(\vec{a}\) and \(\vec{b}\) in the left picture below, the angle is the one shown in the right picture:
Here's the algebraic definition of the dot product; it's rather surprising that this simple definition has anything to do with angles!
Definition 6.1
For two vectors \(\vec{a} = \langle a_1, ..., a_n \rangle\) and \(\vec{b} = \langle b_1, ..., b_n \rangle\) in \(\R^n\text{,}\) 3 the dot product \(\vec{a} \cdot \vec{b}\) is the scalar \(a_1 b_1 + \cdots + a_n b_n\text{.}\)
Example 6.2
If \(\vec{v} = \langle 1, 2, 3 \rangle\) and \(\vec{w} = \langle 4, 5, 6
\rangle\text{,}\) then \(\vec{v} \cdot \vec{w} = (1)(4) + (2)(5) + (3)(6) = 32\text{.}\)
Notice that the dot product is an operation between two vectors in \(\R^n\) that produces a scalar. The key property of the dot product is this one:
Fact 6.3
If \(\theta\) is the angle between \(\vec{a}\) and \(\vec{b}\text{,}\) then \(\vec{a} \cdot \vec{b} = \| \vec{a} \| \|\vec{b}\| \cos \theta\text{.}\) (Remember that \(\|\vec{a}\|\) denotes the length of \(\vec{a}\text{.}\))
(If you're interested in why this is true, see the worksheet on the dot product.)
Example 6.4
Using this key fact, we can find the angle between \(\vec{v} = \langle 1, 2, 3 \rangle\) and \(\vec{w} = \langle 4, 5, 6 \rangle\text{.}\) We already calculated in Example 6.2 that \(\vec{v} \cdot \vec{w} = 32\text{.}\) By the Pythagorean Theorem, \(\|\vec{v}\| = \sqrt{1^2 + 2^2 + 3^2} = \sqrt{14}\) and \(\|\vec{w}\| = \sqrt{4^2 + 5^2 + 6^2} = \sqrt{77}\text{.}\) So, the key fact says that, if \(\theta\) is the angle between \(\vec{v}\) and \(\vec{w}\text{,}\) then \(32 = (\sqrt{14} )(\sqrt{77}) \cos \theta\text{.}\) Therefore, \(\cos \theta = \frac{32}{\left( \sqrt{14} \right) \left( \sqrt{77}
\right)} = \frac{32}{7 \sqrt{22}}\text{,}\) so \(\theta = \arccos \left( \frac{32}{7 \sqrt{22}} \right)\text{.}\)
There's an important special case of Fact 6.3 that we use frequently: if the angle between two vectors \(\vec{a}\) and \(\vec{b}\) is \(90^\circ\text{,}\) then \(\vec{a} \cdot \vec{b} = \|\vec{a}\| \|\vec{b}\| \cos 90^\circ = 0\text{.}\) So, a simple way to test whether two vectors are perpendicular (also called “orthogonal”) is to see whether their dot product is 0. 4
Subsection 6.4 The scalar component
When we write a vector like \(\vec{b} = \langle 2, -3 \rangle\text{,}\) we call \(2\) the \(x\)-component and \(-3\) the \(y\)-component of \(\vec{b}\text{.}\) Similarly, for a vector like \(\vec{b} = \langle 1, -4, 5 \rangle\) in \(\R^3\text{,}\) the numbers 1, \(-4\text{,}\) and 5 are the \(x\)-, \(y\)-, and \(z\)-components of \(\vec{b}\text{.}\) These scalars tell us how far (and in which direction) along each coordinate axis the vector goes. This idea can be generalized to directions other than the coordinate axes.
Why might this be useful? Think about the solar panel example from earlier; if you've installed a solar panel, there's an ideal direction for the light to be going: perpendicularly toward the solar panel. So, you might wonder how much the sunlight is really going in that particular direction.
To describe this mathematically, imagine that we have a vector \(\vec{b}\text{,}\) and we want to know how far \(\vec{b}\) goes along some “axis” (by which we mean a line through the origin). We can describe the positive direction of that “axis” by giving a vector \(\vec{a}\) that points in the positive direction of the axis. For example, if \(\vec{b}\) and \(\vec{a}\) are the vectors in the left picture below, then we can picture an axis indicated by the direction of \(\vec{a}\text{,}\) as in the right picture. (Notice that the length of \(\vec{a}\) isn't really important; it's just the direction of \(\vec{a}\) that tells us how to draw the axis.)
From the picture, we can see that the component of \(\vec{b}\) in the direction of the axis above is 4. We call this the scalar component of \(\vec{b}\) in the direction of \(\vec{a}\) and write it \(\text{comp}_{\vec{a}} \vec{b}\text{.}\)
Here's a second example for you to try.
Example 6.5
Can you estimate the scalar component of \(\vec{b}\) in the direction of \(\vec{a}\) for the vectors shown below? Imagine that \(\vec{a}\) has length 4 and \(\vec{b}\) has length 2.
Solution
First, we draw in the axis indicated by the direction of \(\vec{a}\) (shown in blue below). Then, by dropping a perpendicular from the vector to the axis, we can see that the scalar component of \(\vec{b}\) in the direction of \(\vec{a}\) is about \(-0.5\text{.}\)
In general, how do we calculate the scalar component of \(\vec{b}\) in the direction \(\vec{a}\text{?}\) If you look back at the first example, you should see that, if we know the angle \(\theta\) between \(\vec{a}\) and \(\vec{b}\text{,}\) then the scalar component of \(\vec{b}\) in the direction \(\vec{a}\) is \(\|\vec{b}\| \cos \theta\text{:}\)
The same formula \(\|\vec{b}\| \cos \theta\) also works when the angle between \(\vec{a}\) and \(\vec{b}\) is greater than \(90^\circ\text{.}\) (Do you see why?)
Let's see if we can simplify this formula. As we've seen, the way to find the angle \(\theta\) is to use the dot product. We can rewrite the formula \(\vec{a} \cdot \vec{b} = \|\vec{a}\| \|\vec{b}\| \cos \theta\) as \(\cos \theta = \dfrac{\vec{a} \cdot \vec{b}}{\|\vec{a}\| \|\vec{b}\|}\text{.}\) Therefore, the scalar component of \(\vec{b}\) in the direction of \(\vec{a}\) is
\begin{equation*}
\|\vec{b}\| \cos \theta = \|\vec{b}\| \dfrac{\vec{a}
\cdot \vec{b}}{\|\vec{a}\| \|\vec{b}\|} = \frac{\vec{a} \cdot
\vec{b}}{\|\vec{a}\|}.
\end{equation*}
Since \(\frac{\vec{a}}{\|\vec{a}\|}\) is a unit vector that points in the same direction as \(\vec{a}\text{,}\) we often write this as:
The scalar component of \(\vec{b}\) in the direction of \(\vec{a}\) is \(\vec{b} \cdot (\text{the unit vector in the direction } \vec{a})\text{.}\)
Notice that this formula says that the length of \(\vec{a}\) is irrelevant when calculating the scalar component, which agrees with our geometric understanding.
Subsection 6.5 The cross product (\(\R^3\) only)
If you haven't already, first watch this video on calculating cross products. Now, let's describe what the cross product tells us. Since the cross product is a vector, we can describe it by saying what its magnitude and direction are.
Example 6.6
For \(\vec{a} = \langle a_1, a_2, a_3 \rangle\) and \(\vec{b} = \langle b_1, b_2, b_3 \rangle\text{,}\) what's the angle between \(\vec{a} \times \vec{b}\) and \(\vec{a}\text{?}\) How about between \(\vec{a} \times \vec{b}\) and \(\vec{b}\text{?}\)
Solution
To find the angle between two vectors, we use the dot product formula. So, to find the angle between \(\vec{a} \times \vec{b} = \langle a_2 b_3 - a_3 b_2, a_3 b_1 - a_1
b_3, a_1 b_2 - a_2 b_1 \rangle\) and \(\vec{a}\text{,}\) we first calculate their dot product. If you do this, you find that \((\vec{a} \times \vec{b}) \cdot \vec{a} = 0\text{,}\) so \(\vec{a} \times \vec{b}\) is perpendicular to \(\vec{a}\text{.}\)
Similarly, we can calculate that \((\vec{a} \times \vec{b}) \cdot \vec{b} = 0\text{,}\) so \(\vec{a} \times \vec{b}\) is perpendicular to \(\vec{b}\text{.}\)
As we see from the previous example, \(\vec{a} \times \vec{b}\) is perpendicular to both \(\vec{a}\) and \(\vec{b}\text{.}\) If \(\vec{a}\) and \(\vec{b}\) aren't parallel to each other, this means that \(\vec{a} \times \vec{b}\) has only two possible directions. (Do you see why?) Which of these two directions does \(\vec{a} \times \vec{b}\) point in? It turns out that there's a handy way to describe this, known as the right-hand rule. Orient your right hand so that your index finger is pointing in the direction of \(\vec{a}\) and your middle finger is pointing in the direction of \(\vec{b}\text{.}\) (This may require some contortions!) If you then move your thumb to be perpendicular to your index and middle fingers, it will be pointing in the direction of \(\vec{a} \times \vec{b}\text{,}\) as in the picture below:
Source: https://commons.wikimedia.org/wiki/File:Right_hand_rule_cross_product.svg
There's another way to visualize the right-hand rule, which you can take a look at in \S 2.4 of OpenStax Calculus Volume 3; it's Figure 2.54.
Now that we understand the direction of \(\vec{a} \times \vec{b}\text{,}\) how about its magnitude? If you do a lot of algebra with the formula for \(\vec{a} \times \vec{b}\text{,}\) you find that \(\|\vec{a} \times \vec{b}\| = \|\vec{a}\| \|\vec{b}\| \sin \theta\text{,}\) where \(\theta\) is the angle between \(\vec{a}\) and \(\vec{b}\text{.}\) This fact has a nice geometric interpretation: if you draw a parallelogram with \(\vec{a}\) and \(\vec{b}\) being two of its sides (like in the picture below), then \(\|\vec{a} \times \vec{b}\|\) is the area of this parallelogram.
So, we can now summarize the meaning of the cross product:
If \(\vec{a}\) and \(\vec{b}\) are two vectors in \(\R^3\text{,}\) then \(\vec{a}
\times \vec{b}\) is the vector whose:
You might wonder why the cross product is a useful operation. Imagine you're planning to install a parallelogram-shaped solar panel. There are two key factors that will affect how much sunlight the panel will collect: the area of the panel and the direction that the panel is facing. For example, if the panel is facing the ground, it won't collect any sunlight, even if its area is large! If the parallelogram is described by vectors \(\vec{a}\) and \(\vec{b}\text{,}\) the cross product \(\vec{a} \times \vec{b}\) gives information both about the direction the parallelogram is facing (using the right-hand rule) and the area of the parallelogram (the length of \(\vec{a} \times \vec{b}\)). So, the cross product is a useful tool for calculating how much sunlight the panel can gather. We'll follow up on this idea much later this semester when we study an idea called flux.