Lesson Explainer: Dot Product in 2D Mathematics

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

There are three ways to multiply vectors. Firstly, you can perform a scalar multiplication in which you multiply each component of the vector by a real number, for example, 3⃑𝑣. Here, we would multiply each component in vector ⃑𝑣 by the number three. Secondly, we can multiply a vector by another vector; here, there are two different methods, the dot product and the cross product. In this explainer, we are only going to look at the dot product.

Suppose we have a vector ⃑𝑒 that is 𝑒,π‘’ο…ο—ο˜ and a vector ⃑𝑣 that is 𝑣,π‘£ο…ο—ο˜. Their dot product is written as ⃑𝑒⋅⃑𝑣. Notice here that the dot is central to the two vectors, not at the base of each. Now, to calculate the dot product, we need to write out the two vectors in component form, multiply the corresponding components of each vector, and add the resulting numbers.

Definition: Dot Product of Two Vectors

The dot product of two vectors ⃑𝑒=𝑒,π‘’ο…ο—ο˜ and ⃑𝑣=𝑣,π‘£ο…ο—ο˜ is given by multiplying the corresponding components of each vector and adding the resulting numbers: ⃑𝑒⋅⃑𝑣=𝑒⋅𝑣+𝑒⋅𝑣.ο—ο—ο˜ο˜

This is demonstrated in example 1.

Example 1: Finding the Dot Product of Two-Dimensional Vectors

Given the vector ⃑𝑣=(7,2) and the vector ⃑𝑒=(3,6), find ⃑𝑒⋅⃑𝑣.

Answer

Recall that the dot product of two vectors ⃑𝑒=𝑒,π‘’ο…ο—ο˜ and ⃑𝑣=𝑣,π‘£ο…ο—ο˜ is given by ⃑𝑒⋅⃑𝑣=𝑒⋅𝑣+𝑒⋅𝑣.ο—ο—ο˜ο˜

Hence, we have ⃑𝑒⋅⃑𝑣=(7,2)β‹…(3,6)=7β‹…3+2β‹…6=21+12=33.

Notice in this example that we have written β€œ7β‹…3,” which is another way of writing β€œ7Γ—3.” We use the first notation to avoid any possible confusion with the vector cross product, which, as the name suggests, uses a cross instead of a dot. Notice, too, that the dot product produces an answer that is a numerical value, or a scalar. It is worth noting here that the dot product is also called the scalar product for this reason.

Let us see what happens when we carry out the dot product ο€Ήπ‘˜βƒ‘π‘’ο…β‹…βƒ‘π‘£, where π‘˜ is a nonzero real number and ⃑𝑒=𝑒,π‘’ο…ο—ο˜ and ⃑𝑣=𝑣,π‘£ο…ο—ο˜. The components of π‘˜βƒ‘π‘’ are then ο€Ήπ‘˜π‘’,π‘˜π‘’ο…ο—ο˜ and we find that ο€Ήπ‘˜βƒ‘π‘’ο…β‹…βƒ‘π‘£=π‘˜π‘’β‹…π‘£+π‘˜π‘’β‹…π‘£=π‘˜ο€Ήπ‘’β‹…π‘£+𝑒⋅𝑣=π‘˜ο€Ήβƒ‘π‘’β‹…βƒ‘π‘£ο….ο—ο—ο˜ο˜ο—ο—ο˜ο˜

Similarly, we find that βƒ‘π‘’β‹…ο€Ήπ‘˜βƒ‘π‘£ο…=π‘˜ο€Ήβƒ‘π‘’β‹…βƒ‘π‘£ο… and ο€Ήπ‘˜βƒ‘π‘’ο…β‹…ο€Ήπ‘˜β€²βƒ‘π‘£ο…=π‘˜π‘˜β€²ο€Ήβƒ‘π‘’β‹…βƒ‘π‘£ο….

As this is an important property, let us take note of it here.

Property: Scalar Multiplication and Dot Product

For real numbers π‘˜ and π‘˜β€², we have ο€Ήπ‘˜βƒ‘π‘’ο…β‹…ο€Ήπ‘˜β€²βƒ‘π‘£ο…=π‘˜π‘˜β€²ο€Ήβƒ‘π‘’β‹…βƒ‘π‘£ο….

Additionally, we find from the definition that ⃑𝑣⋅⃑𝑒=𝑣⋅𝑒+𝑣⋅𝑒,ο—ο—ο˜ο˜ which, given that multiplication is commutative, leads to ⃑𝑣⋅⃑𝑒=𝑒⋅𝑣+𝑒⋅𝑣=⃑𝑒⋅⃑𝑣.ο—ο—ο˜ο˜

This proves the commutativity of the dot product.

Property: Commutativity of the Dot Product

The dot product is commutative: ⃑𝑒⋅⃑𝑣=⃑𝑣⋅⃑𝑒.

Let us now consider three vectors ⃑𝑒=𝑒,π‘’ο…ο—ο˜, ⃑𝑣=𝑣,π‘£ο…ο—ο˜, and ⃑𝑀=𝑀,π‘€ο…ο—ο˜ and work out the dot product ⃑𝑒⋅⃑𝑣+⃑𝑀. We have ⃑𝑣+⃑𝑀=𝑣+𝑀,𝑣+π‘€ο…ο—ο—ο˜ο˜; hence, ⃑𝑒⋅⃑𝑣+⃑𝑀=𝑒(𝑣+𝑀)+𝑒𝑣+𝑀=𝑒𝑣+𝑒𝑀+𝑒𝑣+𝑒𝑀=𝑒𝑣+𝑒𝑣+𝑒𝑀+𝑒𝑀.ο—ο—ο—ο˜ο˜ο˜ο—ο—ο—ο—ο˜ο˜ο˜ο˜ο—ο—ο˜ο˜ο—ο—ο˜ο˜

We finally find that ⃑𝑒⋅⃑𝑣+⃑𝑀=⃑𝑒⋅⃑𝑣+⃑𝑒⋅⃑𝑀.

This equation shows that the dot product is distributive.

Property: Distributivity of the Dot Product

The dot product is distributive: ⃑𝑒⋅⃑𝑣+⃑𝑀=⃑𝑒⋅⃑𝑣+⃑𝑒⋅⃑𝑀.

Let us consider a useful property that the dot product has when we take the dot product of a vector with itself, which we will calculate in the following example.

Example 2: Calculating the Dot Product of a Vector with Itself

Given that 𝐴𝐡=(5,12), find 𝐴𝐡⋅𝐴𝐡.

Answer

Recall that the dot product of two vectors ⃑𝑒=𝑒,π‘’ο…ο—ο˜ and ⃑𝑣=𝑣,π‘£ο…ο—ο˜ is given by ⃑𝑒⋅⃑𝑣=𝑒⋅𝑣+𝑒⋅𝑣.ο—ο—ο˜ο˜

Since ⃑𝑒=⃑𝑣=(5,12), we have (5,12)β‹…(5,12)=5β‹…5+12β‹…12=25+144=169.

To see how this result is significant, let us calculate the magnitude of the same vector. First, we draw a sketch of the vector.

We can work out its magnitude by finding its length using the Pythagorean theorem. So, the magnitude of 𝐴𝐡, usually denoted by ‖‖𝐴𝐡‖‖, is calculated as follows: ‖‖𝐴𝐡‖‖=√5+12=√169=13.

If we compare the magnitude and the dot product, we find the following property.

Property: Dot Product and Magnitude

The magnitude of a vector is equal to the square root of its dot product with itself: ‖‖𝐴𝐡‖‖=𝐴𝐡⋅𝐴𝐡.

The dot product of two vectors can be interpreted geometrically, as given in the following definition box.

Definition: Geometrical Definition of the Dot Product

The dot product of two vectors ⃑𝑒 and ⃑𝑣 equals the product of their magnitudes with the cosine of the angle between them: ⃑𝑒⋅⃑𝑣=β€–β€–βƒ‘π‘’β€–β€–β‹…β€–β€–βƒ‘π‘£β€–β€–β‹…πœƒ,cos where πœƒ is the angle between ⃑𝑒 and ⃑𝑣.

The geometrical interpretation shows us that the β€œcloser” the two vectors are, the larger the dot product, because the smaller the angle, the larger its cosine. Therefore, the maximum value of the dot product of two vectors of given magnitudes occurs when the two vectors have the same direction, that is, when the angle between them is zero.

The dot product of two collinear vectors having the same direction is ⃑𝑒⋅⃑𝑣=‖‖⃑𝑒‖‖⋅‖‖⃑𝑣‖‖⋅0,cos which, since cos0=1, gives ⃑𝑒⋅⃑𝑣=‖‖⃑𝑒‖‖⋅‖‖⃑𝑣‖‖.

This is consistent with what we have found before for the dot product of a vector with itself.

When two vectors ⃑𝑒 and ⃑𝑣 are collinear but have opposite directions, the angle between them is 180∘, with a cosine of βˆ’1, so that their dot product is then given by ⃑𝑒⋅⃑𝑣=βˆ’β€–β€–βƒ‘π‘’β€–β€–β‹…β€–β€–βƒ‘π‘£β€–β€–.

On the other hand, when two vectors ⃑𝑒 and ⃑𝑣 are perpendicular, their dot product is zero since the cosine of the angle between them (90∘) is zero. It is an important property that can be used to check whether two vectors of given components are perpendicular.

Property: Dot Product of Two Perpendicular Vectors

The dot product of two perpendicular vectors is zero. Conversely, when the dot product of two vectors is zero, the two vectors are perpendicular.

Let us look at an example where we need to use this property.

Example 3: Finding the Dot Product of Two Vectors in a Square

Square 𝐴𝐡𝐢𝐷 has a side of 10 cm. What is οƒ π΄π΅β‹…οƒŸπ΅πΆ?

Answer

We can start answering this question by sketching square 𝐴𝐡𝐢𝐷 and vectors 𝐴𝐡 and οƒŸπ΅πΆ.

We see that 𝐴𝐡 and οƒŸπ΅πΆ are perpendicular since two adjacent sides of a square are perpendicular. The angle between the two vectors is 90∘, and, as cos90=0∘, we have οƒ π΄π΅β‹…οƒŸπ΅πΆ=β€–β€–οƒ π΄π΅β€–β€–β‹…β€–β€–οƒŸπ΅πΆβ€–β€–β‹…90=0.cos∘

The answer is οƒ π΄π΅β‹…οƒŸπ΅πΆ=0.

Let us look at another example where we need to use the property of perpendicular vectors.

Example 4: Finding the Missing Component of a Vector Given That It Is Perpendicular to Another

Given that ⃑𝐴=(βˆ’4,π‘˜), ⃑𝐡=(βˆ’12,βˆ’3), and βƒ‘π΄βŸ‚βƒ‘π΅, determine the value of π‘˜.

Answer

⃑𝐴 and ⃑𝐡 are two perpendicular vectors; this means that their dot product is zero. Let us therefore calculate their dot product using their components: ⃑𝐴⋅⃑𝐡=𝐴⋅𝐡+𝐴⋅𝐡,ο—ο—ο˜ο˜ where 𝐴,π΄ο…ο—ο˜ are the components of ⃑𝐴 and 𝐡,π΅ο…ο—ο˜ are those of ⃑𝐡.

Substituting into our equations the actual components of ⃑𝐴 and ⃑𝐡, we get ⃑𝐴⋅⃑𝐡=βˆ’4β‹…(βˆ’12)+π‘˜β‹…(βˆ’3)⃑𝐴⋅⃑𝐡=48βˆ’3π‘˜.

As ⃑𝐴 and ⃑𝐡 are perpendicular, their dot product is zero, which gives 48βˆ’3π‘˜=03π‘˜=48π‘˜=16.

With our last example, we will see how to find a dot product using its geometric definition.

Example 5: Finding the Dot Product of Two Vectors in a Triangle

Given that 𝐴𝐡𝐢 is an isosceles triangle, where 𝐴𝐡=𝐴𝐢=6cm and π‘šβˆ π΄=120∘, determine οƒ πΆπ΄β‹…οƒŸπ΅πΆ.

Answer

Let us first sketch triangle 𝐴𝐡𝐢 and vectors 𝐢𝐴 and οƒŸπ΅πΆ.

We are asked to find οƒ πΆπ΄β‹…οƒŸπ΅πΆ. For this, we need to work out the angle between 𝐢𝐴 and οƒŸπ΅πΆ and the magnitude of οƒŸπ΅πΆ.

To find the angle πœƒ between the two vectors, we draw a vector ⃑𝑒 equivalent to οƒŸπ΅πΆ so that the initial points of ⃑𝑒 and 𝐢𝐴 are coincident.

In isosceles triangle 𝐴𝐡𝐢, π‘šβˆ πΆ=π‘šβˆ π΅=180βˆ’1202=30∘∘∘. The angle between οƒŸπΆπ΅ and ⃑𝑒 is 180∘; therefore, we have πœƒ=180βˆ’30=150.∘∘∘

To find the magnitude of οƒŸπ΅πΆ, since we are given the lengths of 𝐴𝐡 and 𝐴𝐢, we simply consider that the magnitudes of the vectors are given here by their lengths in centimetres. Hence, we need to find length 𝐡𝐢. For this, we can use the sine rule in triangle 𝐴𝐡𝐢. It gives 630=𝐡𝐢120𝐡𝐢=612030𝐡𝐢=6⋅𝐡𝐢=6√3.sinsinsinsincm∘∘∘∘√

We can now find οƒ πΆπ΄β‹…οƒŸπ΅πΆ by writing that οƒ πΆπ΄β‹…οƒŸπ΅πΆ=β€–β€–οƒ πΆπ΄β€–β€–β‹…β€–β€–οƒŸπ΅πΆβ€–β€–β‹…πœƒ,cos where πœƒ is the angle between 𝐢𝐴 and οƒŸπ΅πΆ. Substituting the magnitudes of ‖‖𝐢𝐴‖‖ and β€–β€–οƒŸπ΅πΆβ€–β€– and the value of πœƒ into our equation gives us οƒ πΆπ΄β‹…οƒŸπ΅πΆ=6β‹…6√3β‹…150.cos∘

With cos150=βˆ’βˆš32∘, we find οƒ πΆπ΄β‹…οƒŸπ΅πΆ=6β‹…6√3β‹…ο€Ώβˆ’βˆš32ο‹οƒ πΆπ΄β‹…οƒŸπ΅πΆ=βˆ’54.

As a final note, let us see how to derive the law of cosines using the distributivity of the dot product and its geometrical definition. For any three points 𝐴, 𝐡, and 𝐢, we can write β€–β€–οƒŸπ΅πΆβ€–β€–=οƒŸπ΅πΆβ‹…οƒŸπ΅πΆ=𝐡𝐴+𝐴𝐢⋅𝐡𝐴+𝐴𝐢.

Expanding the parentheses, we find that β€–β€–οƒŸπ΅πΆβ€–β€–=‖‖𝐡𝐴‖‖+𝐡𝐴⋅𝐴𝐢+𝐴𝐢⋅𝐡𝐴+‖‖𝐴𝐢‖‖.

Since 𝐡𝐴⋅𝐴𝐢=𝐴𝐢⋅𝐡𝐴, we have β€–β€–οƒŸπ΅πΆβ€–β€–=‖‖𝐡𝐴‖‖+‖‖𝐴𝐢‖‖+2𝐡𝐴⋅𝐴𝐢.

Let πœƒ be the angle between 𝐡𝐴 and 𝐴𝐢 as shown in the diagram above. We have β€–β€–οƒŸπ΅πΆβ€–β€–=‖‖𝐡𝐴‖‖+‖‖𝐴𝐢‖‖+2β€–β€–οƒ π΅π΄β€–β€–β‹…β€–β€–οƒ π΄πΆβ€–β€–β‹…πœƒ.cos

The angle between 𝐴𝐡 and ⃑𝑒 is 180∘; therefore, we have πœƒ=180βˆ’π‘šβˆ π΅π΄πΆ.∘

And, as coscos(180βˆ’π‘₯)=βˆ’π‘₯∘ for any π‘₯, we find β€–β€–οƒŸπ΅πΆβ€–β€–=‖‖𝐡𝐴‖‖+β€–β€–οƒ π΄πΆβ€–β€–βˆ’2β€–β€–οƒ π΅π΄β€–β€–β‹…β€–β€–οƒ π΄πΆβ€–β€–β‹…βˆ π΅π΄πΆ,cos which corresponds to the law of cosines, π‘Ž=𝑏+π‘βˆ’2𝑏𝑐𝐴,cos with π‘Ž=𝐡𝐢, 𝑏=𝐴𝐢, 𝑐=𝐡𝐴, and 𝐴=∠𝐡𝐴𝐢.

Let us summarize what we have learned in this explainer.

Key Points

  • The dot product of two vectors ⃑𝑒=𝑒,π‘’ο…ο—ο˜ and ⃑𝑣=𝑣,π‘£ο…ο—ο˜ is given by multiplying the corresponding components of each vector and adding the resulting numbers: ⃑𝑒⋅⃑𝑣=𝑒𝑣+𝑒𝑣.ο—ο—ο˜ο˜
  • We have ο€Ήπ‘˜βƒ‘π‘’ο…β‹…ο€Ήπ‘˜β€²βƒ‘π‘£ο…=π‘˜π‘˜β€²ο€Ήβƒ‘π‘’β‹…βƒ‘π‘£ο….
  • The dot product is commutative: ⃑𝑒⋅⃑𝑣=⃑𝑣⋅⃑𝑒.
  • The dot product is distributive: ⃑𝑒⋅⃑𝑣+⃑𝑀=⃑𝑒⋅⃑𝑣+⃑𝑒⋅⃑𝑀.
  • The dot product of two vectors ⃑𝑒 and ⃑𝑣 equals the product of their magnitudes with the cosine of the angle between them: ⃑𝑒⋅⃑𝑣=β€–β€–βƒ‘π‘’β€–β€–β‹…β€–β€–βƒ‘π‘£β€–β€–β‹…πœƒ,cos where πœƒ is the angle between ⃑𝑒 and ⃑𝑣.
  • The dot product of two perpendicular vectors is zero. Conversely, when the dot product of two vectors is zero, the two vectors are perpendicular.

Download the Nagwa Classes App

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

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