Lesson Video: Dot Product in 2D | Nagwa Lesson Video: Dot Product in 2D | Nagwa

Lesson Video: Dot Product in 2D Mathematics

In this video, we will learn how to find the dot product of two vectors in 2D.

17:59

Video Transcript

Dot Product in Two Dimensions

In this video, we’ll learn how to find the dot product between two vectors. We’ll see one way of interpreting this geometrically. And we’ll see how we can use this to find various properties of our vectors, for example, the magnitude of two vectors, the angle between two vectors, and how to determine whether two vectors are perpendicular. First, we’re going to need to discuss exactly what we mean by the dot product between two vectors. So let’s start with a vector 𝐮 equal to the vector 𝑥 one, 𝑦 one and a vector 𝐯 equal to the vector 𝑥 two, 𝑦 two.

Now we’ve already seen one way of multiplying a vector. For example, we know how to do scalar multiplication of a vector and a scalar. In this scenario, we would just multiply each component of our vector by our scalar. However, that’s the product between a vector and a scalar. The dot product is going to give us a method of multiplying two vectors together. We represent the dot product with a dot between our two vectors. This says the dot product between the vector 𝐮 and the vector 𝐯. Now, to find the dot product between two vectors, we want to find the sum of the product of corresponding components of our two vectors. So for vectors 𝐮 and 𝐯, the dot product between 𝐮 and 𝐯 will be 𝑥 one times 𝑥 two plus 𝑦 one times 𝑦 two. All we do is multiply the corresponding components and then add all of these together.

And there’s something that’s worth pointing out here. First, we can see we start with two vectors. However, the result of this is just going to be a number. Because we just end up with a number or a scalar, sometimes the dot product is called the scalar product. Next, we can see in our definition we need to multiply corresponding components together. So we can only take the dot product between two vectors if they have the same number of components, or in other words they need to have the same dimension. Another thing worth pointing out here is the position of the dot in the dot product. We write this in the middle and not at the base of our two vectors. Finally, it’s worth pointing out we can in fact extend this definition to vectors with more dimensions.

If instead of the vectors 𝐮 and 𝐯 we have the vectors 𝐮 star and 𝐯 star, where the components of 𝐮 star are 𝑢 one, 𝑢 two all the way up to 𝑢 𝑛 and the components of 𝐯 star are 𝑣 one, 𝑣 two all the way up to 𝑣 𝑛, then once again we can calculate the dot product of these two vectors in exactly the same way. We take the product of corresponding components and then add all of these together. 𝐮 star dot 𝐯 star is equal to 𝑢 one 𝑣 one plus 𝑢 two 𝑣 two all the way up to adding 𝑢 𝑛 𝑣 𝑛. And, of course, this only makes sense if 𝐮 star and 𝐯 star have the same dimension. However, in this video, we’re going to focus on the case of two dimensions. Let’s now see an example of how we would calculate the dot product of two vectors.

Given the vector 𝐯 is seven, two and the vector 𝐮 is three, six, find the dot product between 𝐮 and 𝐯.

In this question, we’re given two vectors, and we can see that both of these vectors are in two dimensions. This is because each vector has two components. We’re asked to find the dot product between these two vectors. So let’s start by recalling how we calculate the dot product between two vectors in two dimensions. We recall if 𝐮 is the vector 𝑥 one, 𝑦 one and 𝐯 is the vector 𝑥 two, 𝑦 two, then to calculate the dot product between 𝐮 and 𝐯, we want to add together the products of the corresponding components. In other words, 𝐮 dot 𝐯 is equal to 𝑥 one times 𝑥 two plus 𝑦 one times 𝑦 two.

In the question, we’re told that 𝐮 is the vector three, six. So we’ll set 𝑥 one equal to three and 𝑦 one equal to six. And we’re also told that 𝐯 is the vector seven, two. So we’ll set 𝑥 two equal to seven and 𝑦 two equal to two. This means we’re now ready to calculate the dot product between 𝐮 and 𝐯. We need to find the product of all the corresponding components and then add these together. In this case, that’s three times seven plus six times two. And this gives us 21 plus 12, which we can evaluate is equal to 33. Therefore, we were able to show the dot product between 𝐮 and 𝐯 is 33.

However, there is one more question we can ask. What if instead we were asked to calculate the dot product between 𝐯 and 𝐮? To calculate the dot product between 𝐯 and 𝐮, we would set up our dot product in exactly the same way. However, the roles of 𝐮 and 𝐯 would be switched around. Now, to calculate this dot product, we want to multiply the corresponding components and add the results. This gives us seven times three plus two times six. But now we can notice something interesting. We know that multiplication is commutative, so we could’ve written these in the opposite order. And then, we would get exactly the same statement as the dot product between 𝐮 and 𝐯. And because multiplication is always commutative, we can always do this.

So for these two specific vectors, the dot product between 𝐯 and 𝐮 is equal to 33. However, more importantly, for any two vectors 𝐮 and 𝐯, the dot product between 𝐮 and 𝐯 is going to be equal to the dot product between 𝐯 and 𝐮. And of course, it’s worth pointing out the same statement holds in higher dimensions.

Let’s see an example of how we can use the dot product to calculate the magnitude of a vector.

𝐀 dot 𝐀 is equal to blank.

In this question, we’re given a vector 𝐀 and we’re asked to find an expression for the dot product between the vector 𝐀 and itself. There’s a few different ways of doing this. Let’s start with vector 𝐀 being a two-dimensional vector. So let’s let 𝐀 be the vector with horizontal component 𝑎 one and vertical component 𝑎 two. We want to find an expression for the dot products of 𝐀 with itself. Now, remember, to find a dot product between two vectors, we need to multiply the corresponding components and then add all of the results. So in this case, we multiply the first components together. That’s 𝑎 one times 𝑎 one. And then we need to add the second components multiplied together. That’s 𝑎 two times 𝑎 two. And of course we can simplify this to give us 𝑎 one squared plus 𝑎 two squared.

Now, we could leave our answer like this for the two-dimensional case. However, this is actually equal to a very useful result. We need to notice that this appears in the modulus of 𝐀. Recall that the modulus of a vector is the sums of the squares of its component and then we take the square root of this value. In this case, the modulus of 𝐀 is the square root of 𝑎 one squared plus 𝑎 two squared. And this is of course the square root of the expression we have for the dot product between 𝐀 and itself.

So if we were to square the modulus of 𝐀, then we would see something interesting. The modulus of 𝐀 squared is 𝑎 one squared plus 𝑎 two squared, the sums of the squares of its components. Therefore, we’ve shown, in the two-dimensional case, the dot product between 𝐀 and itself is equal to the modulus of 𝐀 squared. And in fact, we can show exactly the same result is true for vectors in any number of dimensions. If we let 𝐀 be the 𝑛-dimensional vector 𝑎 one, 𝑎 two all the way up to 𝑎 𝑛, then we can calculate the dot product between the vector 𝐀 and itself in exactly the same way. We multiply the corresponding components and add the results. This is 𝑎 one times 𝑎 one plus 𝑎 two times 𝑎 two, and we add all the way up to 𝑎 𝑛 times 𝑎 𝑛.

We can simplify each term in exactly the same way we did before. And in exactly the same way, the sums of the squares of the components will be the modulus of 𝐀 squared. Therefore, we were able to show the dot product between a vector 𝐀 and itself is equal to the modulus of 𝐀 squared.

Let’s now see how we can use this result to help us prove a very useful formula to do with the dot product. We want to use the dot product to help us find the angle between two vectors. So let’s consider the following two vectors: vector 𝐮 and vector 𝐯. And remember, what’s important about vectors is their magnitude and direction, so we can draw both of our vectors starting at the origin. We want to find the value of 𝜃, which is the angle between our two vectors. And let’s also say that 𝐮 is the vector 𝑥 one, 𝑦 one and 𝐯 is the vector 𝑥 two, 𝑦 two.

And before we continue, it’s worth pointing out that the exact same reasoning we’re going to use will work in higher dimensions. However, it’s easier to visualize this in two dimensions. To help us find the value of 𝜃, we’re going to use what we know about the dot product and some trigonometry. First, we construct the following triangle by constructing the vector 𝐯 minus 𝐮. And we know we can find an expression for this vector by subtracting 𝐮 from 𝐯 component-wise. It’s the vector 𝑥 two minus 𝑥 one, 𝑦 two minus 𝑦 one.

At this point, there’s two things we can do to this diagram. Let’s first try applying the laws of cosines to this diagram. Remember, we can find the lengths of these vectors by taking the modulus of them. And our angle 𝜃 is opposite the side with length modulus of 𝐯 minus 𝐮. Therefore, applying the laws of cosines to this triangle, we get the modulus of 𝐯 minus 𝐮 all squared is equal to the modulus of 𝐮 squared plus the modulus of 𝐯 squared minus two times the modulus of 𝐮 times the modulus of 𝐯 multiplied by the cos of 𝜃.

Now, if we knew the vectors 𝐮 and 𝐯, we could find the angle between them by using this formula. However, we can actually simplify this formula by using what we know about dot products. Remember, a vector dot producted with itself is equal to its magnitude squared. Therefore, the magnitude of 𝐯 minus 𝐮 all squared is actually equal to the vector 𝐯 minus 𝐮 dot producted with the vector 𝐯 minus 𝐮. And we know an expression component-wise for the vector 𝐯 minus 𝐮. So we can write these two vectors out in full and actually calculate the dot product. We need to multiply the first components together and then add on the product of the second components. This simplifies to give us 𝑥 two minus 𝑥 one all squared plus 𝑦 two minus 𝑦 one all squared.

Let’s now distribute the squares over both of our parentheses. Distributing and rearranging, we get 𝑥 two squared plus 𝑥 one squared minus two 𝑥 one 𝑥 two plus 𝑦 two squared plus 𝑦 one squared minus two 𝑦 one 𝑦 two. And at first, it might not seem like we’re simplifying at all. However, we can now simplify this expression. First, we notice 𝑥 one squared plus 𝑦 one squared is the modulus of 𝐮 squared. Similarly, 𝑥 two squared plus 𝑦 two squared is the modulus of 𝐯 squared. And for our last two terms, we’re going to start by taking out the shared factor of negative two. And this gives us an extra term of negative two times 𝑥 one 𝑥 two plus 𝑦 one 𝑦 two.

But we know how to simplify 𝑥 one times 𝑥 two plus 𝑦 one times 𝑦 two by using our dot product. Inside of our parentheses is exactly the dot product between the vectors 𝐮 and 𝐯. So let’s think about exactly what we’ve shown. We found two different expressions for the modulus of 𝐯 minus 𝐮 all squared. Therefore, these two expressions have to be equal. So let’s set both of these two expressions equal to each other. We can immediately see some ways of simplifying. For example, we can subtract the modulus of 𝐮 squared and the modulus of 𝐯 squared from both sides of the equation. This leaves us with negative two times the modulus of 𝐮 multiplied by the modulus of 𝐯 times the cos of 𝜃 is equal to negative two times the dot product between 𝐮 and 𝐯.

Of course, we can simplify this further. We can divide through by negative two. And remember, when we initially set up this problem, we wanted to find the angle between vectors 𝐮 and 𝐯. So in particular, it wouldn’t be very useful if either 𝐮 or 𝐯 was the zero vector because then we couldn’t find the angle between these vectors anyway. It wouldn’t make sense. So in this context, it makes sense that the modulus of 𝐮 and the modulus of 𝐯 is not zero. So we’ll divide through by this, and this gives us a really useful result. If 𝜃 is the angle between the vectors 𝐮 and 𝐯, then the cos of 𝜃 will be equal to the dot product between 𝐮 and 𝐯 divided by the magnitude of 𝐮 times the magnitude of 𝐯. And of course, we can solve for 𝜃 by taking the inverse cosine of both sides of this equation.

And there is something interesting worth pointing out about our value of 𝜃. Our value of 𝜃 is going to be between zero and 180 degrees inclusive. And this makes sense if we looked at our diagram. Of course, in any diagram, there’s two possible values for 𝜃. We could have the internal angle between our two vectors, or we could have the external angle between these two vectors. Both are solutions to this equation; however, we’re interested in the internal angle.

Let’s see an example of how we could use this to find the angle between two vectors.

Given the vectors 𝐮 four, one and 𝐯 two, five, find their dot product and the angle between them to one decimal place.

In this question, we’re given two two-dimensional vectors 𝐮 and 𝐯, and we’re asked to determine two things. First, we need to find the dot product between these two vectors. Then, we need to find the angle between these two vectors, and we need to give our answer to one decimal place. To do this, let’s start by recalling how we calculate the dot product between two vectors. We recall if 𝐮 is the vector 𝑥 one, 𝑦 one and 𝐯 is the vector 𝑥 two, 𝑦 two, then the dot product between 𝐮 and 𝐯 is the sum of the products of their corresponding components. So 𝐮 dot 𝐯 is 𝑥 one times 𝑥 two plus 𝑦 one times 𝑦 two.

We want to use this to find the dot product between the vector four, one and the vector two, five. We need to multiply the corresponding components together and then add these. That’s four times two plus one times five. And of course, this simplifies to give us eight plus five, which is equal to 13. The next part of this question wants us to determine the angle between these two vectors. So let’s start by recalling how we do this. We recall if 𝜃 is the angle between the vectors 𝐮 and 𝐯, then the cos of 𝜃 will be equal to the dot product of 𝐮 and 𝐯 divided by the modulus of 𝐮 times the modulus of 𝐯.

We’ve already found the dot product between these two vectors, so let’s find the modulus of each vector. Remember, to find the modulus of a vector, we need to sum the squares of the components and take the square root of this value. The modulus of 𝐮 is the square root of four squared plus one squared, which we can calculate is equal to the square root of 17. Similarly, the modulus of 𝐯 will be the square root of two squared plus five squared, which we can calculate is the square root of 29. Now we can substitute these values into our formula. Doing this gives us the cos of 𝜃 is equal to 13 divided by the square root of 17 times the square root of 29.

Finally, we can find our value of 𝜃 by taking the inverse cosine of both sides of the equation. This gives us 𝜃 is equal to the inverse cos of 13 divided by root 17 times root 29, which to one decimal place is 54.2 degrees, which is our final answer. It’s also worth pointing out it can be useful to check our answer by sketching both of these vectors on a diagram. If we were to do this, we would get a sketch which looks like this. The horizontal component of 𝐮 is four, and the vertical component is one. And the horizontal component of 𝐯 is two, and the vertical component is five. And we draw both vectors starting from the origin, giving us that 𝜃 is the angle between them. We could then also find the value of 𝜃 by using trigonometry. Either way, we showed the dot product between these two vectors was 13 and the angle between them to one decimal place was 54.2 degrees.

Let’s now see an example where the angle between our vectors is obtuse.

Find the angle between the vectors 𝐮 three, negative two and 𝐯 negative five, negative three. Give your answer to one decimal place.

We want to find the angle between two vectors. So let’s start by sketching the situation. Our vector 𝐮 has horizontal component three and vertical component negative two. And our vector 𝐯 has horizontal component negative five and vertical component negative three. We want to find the angle between these two vectors. This will be the angle 𝜃, and we know a formula to do this. We recall if 𝜃 is the angle between two vectors 𝐮 and 𝐯, then the cos of 𝜃 will be equal to the dot product of 𝐮 and 𝐯 divided by the modulus of 𝐮 times the modulus of 𝐯.

So to find our value of 𝜃, we need to find the dot product of our two vectors and both of their magnitudes. Let’s start with the dot product. Remember, to find the dot product of two vectors, we multiply their corresponding components and add the result. This gives us three times negative five plus negative two times negative three, which we can calculate is equal to negative nine. Let’s now find the modulus of our vectors 𝐮 and 𝐯. Let’s start with the modulus of 𝐮. We need to take the square root of the squares of the sum of our components. The modulus of 𝐮 is the square root of three squared plus negative two all squared, which we can calculate is the square root of 13.

We can do the same to find the modulus of 𝐯. It’s the square root of negative five squared plus negative three squared, which is the square root of 34. Now we can substitute these values into our formula and take the inverse cosine to find our value of 𝜃. This gives us that 𝜃 will be the inverse cos of negative nine divided by the square root of 13 times the square root of 34, which to one decimal place is our final answer of 115.3 degrees.

Let’s now see one last example of how this angle formula can be used.

Given that 𝐀 is the vector negative four, 𝑘 and 𝐁 is the vector negative 12, negative three and 𝐀 is perpendicular to 𝐁, determine the value of 𝑘.

In this question, we’re given two vectors and we’re told that 𝐀 is perpendicular to 𝐁. We need to use this to determine our value of 𝑘. To answer this question, let’s first recall if 𝐀 and 𝐁 are perpendicular, then the angle between them must be equal to 90 degrees. And this is useful because we also know a formula involving the angle between two vectors. We recall if 𝜃 is the angle between two vectors 𝐀 and 𝐁, then the cos of 𝜃 will be equal to the dot product of 𝐀 and 𝐁 divided by the magnitude of 𝐀 times the magnitude of 𝐁. And in our question, our vectors are perpendicular, so the angle between them, 𝜃, should be equal to 90 degrees.

So we can ask the question, what happens if we substitute the value of 90 degrees into this formula? Well, the cos of 90 degrees is equal to zero. Therefore, the dot product of 𝐀 and 𝐁 divided by the magnitude of 𝐀 times the magnitude of 𝐁 should be equal to zero. And we can see the only way this will happen will be if the dot product between 𝐀 and 𝐁 is zero. This gives us a really useful result about two vectors. If 𝐮 and 𝐯 are perpendicular, then their dot product must be equal to zero. We can now use this to answer our question. 𝐀 and 𝐁 are perpendicular, so their dot product is equal to zero. So we can find an equation for 𝐀 by solving the dot product of these two vectors is equal to zero.

Remember, to find the dot product of two vectors, we multiply the corresponding components and add the results. So the dot product of 𝐀 and 𝐁 is negative four times negative 12 plus 𝑘 times negative three, which we can simplify. Negative four times negative 12 is 48, and 𝑘 times negative three is negative three 𝑘. And remember, this is equal to zero because 𝐀 and 𝐁 are perpendicular. Now we can just rearrange this equation for 𝑘. We add three 𝑘 to both sides of our equation and divide through by three, giving us if the vectors 𝐀 and 𝐁 are perpendicular, then our value of 𝑘 must be equal to 16.

Now let’s go over the key points of this video. First, we saw if 𝐮 is a vector with components 𝑢 one, 𝑢 two up to 𝑢 𝑛 and 𝐯 is the vector with components 𝑣 one, 𝑣 two up to 𝑣 𝑛, then we can calculate the dot product between 𝐮 and 𝐯 by multiplying the corresponding components and then adding all of these together. We also saw this only makes sense if they have the same number of components. In other words, our vectors must be of the same dimension. We also saw that the result we get from the dot product of two vectors is a scalar. So this is sometimes called the scalar product.

Next, we saw a few useful results involving the dot product, the most important of which is if 𝜃 is the angle between 𝐮 and 𝐯, then the cos of 𝜃 will be equal to the dot product of 𝐮 and 𝐯 divided by the modulus of 𝐮 times the modulus of 𝐯. And this gives us a useful result. If 𝐮 and 𝐯 are perpendicular vectors, the angle between them should be 90 degrees. And the cos of 90 is zero, so the only way this can happen is if the dot product between 𝐮 and 𝐯 is zero.

Download the Nagwa Classes App

Attend sessions, chat with your teacher and class, and access class-specific questions. Download Nagwa Classes app today!

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.