Chapter 1: Vectors, Lines and Planes
Section 1.3: Dot Product
Example 1.3.3
Using the law of cosines, verify the equivalence of A·B and ABcos(θ)
Solution
Mathematical Solution
Apply the law of cosines, namely,
c2=a2+b2−2 a b cosθ
to the triangle formed by the vectors A (in red), B (in green), and B−A (in black) in Figure 1.3.3(a). The angle θ is formed by the vectors A and B.
Setting a=A, b=B, and c=B−A in the law of cosines leads to the following.
Figure 1.3.3(a) Triangle formed by vectors A, B, and B−A
c2
= a2+b2−2 a b cosθ
B−A2
= A2+ B2 −2A B cos(θ)
B−A·B−A
= A·A+B·B−2A B cos(θ)
B·B−2 A·B+A·A
−2 A·B
= −2A B cos(θ)
A·B
= A B cos(θ)
Maple Solution - Interactive
Load the Student LinearAlgebra package so that the norm of a vector defaults to the Euclidean norm. Then define the A and B as generic vectors in ℝ3.
Initialize
Tools≻Load Package: Student Multivariate Calculus
Loading Student:-MultivariateCalculus
Define A as per Table 1.1.1.
Context Panel: Assign Name
A=a1,a2,a3→assign
Define B as per Table 1.1.1.
B=b1,b2,b3→assign
Obtain the dot product of A and B
Common Symbols palette: Dot-product operator
Context Panel: Evaluate and Display Inline
A·B = a1⁢b1+a2⁢b2+a3⁢b3
Write the law of cosines in the form a b cosθ=a2+b2−c2/2.
Apply this to the vectors A, B, and B−A in the triangle in Figure 1.3.3(a).
Write the expression corresponding to the numerator a2+b2−c2 and press the Enter key.
Context Panel: Expand≻Expand
Using the equation label (implement with Control L), divide the expanded expression by 2
A 2+∥ B ∥2−B−A2
a12+a22+a32+b12+b22+b32−b1−a12−b2−a22−b3−a32
= expand
2⁢a1⁢b1+2⁢a2⁢b2+2⁢a3⁢b3
2
a1⁢b1+a2⁢b2+a3⁢b3
In terms of components, and using the law of cosines, these calculations show that
A·B=a1⁢b1+a2⁢b2+a3⁢b3=A B cos(θ)
Maple Solution - Coded
The following calculations will establish that A·B=a1⁢b1+a2⁢b2+a3⁢b3=A B cos(θ), as per the remarks above about the use of the law of cosines.
Install the Student MultivariateCalculus package.
withStudent:-MultivariateCalculus:
Define the vectors A and B.
A,B≔a1,a2,a3,b1,b2,b3:
Compute the dot product
Apply the DotProduct command".
DotProductA,B
Obtain A2, B2, and B−A2
Apply the Norm command to vectors A, B, and B−A.
NormA2
a12+a22+a32
NormB2
b12+b22+b32
NormB−A2
b1−a12+b2−a22+b3−a32
Combine to obtain (∥ A ∥2+ B 2−∥B−A∥2)/2
Use equation labels and apply the expand command.
expand+−/2
<< Previous Example Section 1.3 Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
Download Help Document