Multivariable-Calculus · Unit 1 · Video 3 · Interactive Practice
The Dot Product: Componentwise Definition and the Law of Cosines Proof
IKey Formulas
Formula
Name
What you need
A⋅B=a1b1+a2b2+a3b3
Componentwise definition
The components of both vectors
A⋅B=∣A∣∣B∣cosθ
The theorem (geometric form)
Both lengths and the angle between them
A⋅A=∣A∣2=a12+a22+a32
Step 1 of the proof
θ=0, and cos0=1
∣C∣2=∣A∣2+∣B∣2−2∣A∣∣B∣cosθ
Law of cosines, with C=A−B
Two sides and the included angle
Key Insight: The theorem and the law of cosines are one fact in two dialects. Comparing the two computations of ∣C∣2 derives either statement from the other; the output is always a scalar, never a vector.
IIVisualization 1 — One Scalar, Two Readings
The componentwise sum and ∣A∣∣B∣cosθ return the same number for every pair of arrows.
💡 Swapping A and B changes neither computation — the definition is symmetric, which is exactly why the two middle terms of the proof's expansion combine.
IIIVisualization 2 — The Correction Term
Pythagoras contributes ∣A∣2+∣B∣2; the angle alone decides what must be subtracted.
IVVisualization 3 — Two Computations of ∣C∣2
The algebraic expansion and the law of cosines agree in every term but the last.
1 · the third side
C=A−B
2 · a vector with itself
∣C∣2=C⋅C=(A−B)⋅(A−B)
3 · it distributes
=A⋅A−A⋅B−B⋅A+B⋅B
4 · the middle terms are equal
∣C∣2=∣A∣2+∣B∣2−2A⋅B
5 · the law of cosines
∣C∣2=∣A∣2+∣B∣2−2∣A∣∣B∣cosθ
6 · all but the last term match
A⋅B=∣A∣∣B∣cosθ
💡 Lines 2–4 contain no cosine anywhere; the expansion simply ends on A⋅B. The cosine reappears only when that dot product is rewritten in lengths and angle.
VQuiz Questions
Problem 1 · Componentwise Computation
Given:A=⟨2,−1,3⟩ and B=⟨4,5,−2⟩ — findA⋅B.
✅ Correct!8+(−5)+(−6)=−3. The negative sign already says something geometric: cosθ<0, so the angle between these two vectors is obtuse.
❌ Signs dropped.19=8+5+6 treats every product as positive. Two of the three products are negative here: (−1)(5)=−5 and (3)(−2)=−6.
❌ That is a vector, not a scalar. Those are the three individual products — the definition adds them up. Two vectors go in, one number comes out.
❌ Check the third product.(3)(−2)=−6, not +6. With the correct sign, 8−5−6=−3.
❌ Not quite. Multiply matching components and add: (2)(4)+(−1)(5)+(3)(−2).
Show solution
Apply the componentwise definition, one matching pair at a time:
A⋅B=(2)(4)+(−1)(5)+(3)(−2)=8−5−6=−3
Two checks worth making every time. First, the answer is a single number — if a triple of numbers survives, the addition step was skipped. Second, the sign is meaningful: since A⋅B=∣A∣∣B∣cosθ and lengths are positive, a negative dot product means cosθ<0.
Problem 2 · A Vector With Itself
Given:A=⟨1,−2,2⟩ — findA⋅A.
✅ Correct!1+4+4=9=∣A∣2 — the componentwise definition and the geometric formula agree, which is step 1 of the proof.
❌ That is a vector, not a scalar. Those are the three squared components; the definition adds them: 1+4+4=9.
❌ That is ∣A∣, not A⋅A. The length is 1+4+4=3, so A⋅A=∣A∣2=9 — the square root is exactly what does not get taken here.
❌ Only one factor. The angle between A and itself is 0 and cos0=1, but the formula still carries the two lengths: ∣A∣∣A∣cos0=9⋅1=9.
❌ Not quite. Dot the vector with itself componentwise: (1)(1)+(−2)(−2)+(2)(2).
Show solution
From the definition:
A⋅A=(1)(1)+(−2)(−2)+(2)(2)=1+4+4=9
From the geometry: the angle between A and itself is 0, so
A⋅A=∣A∣∣A∣cos0=∣A∣2
and indeed ∣A∣=1+4+4=3, giving ∣A∣2=9. The two routes agree — that agreement is step 1 of the theorem's proof, and it is what licenses writing ∣C∣2=C⋅C in step 2.
Problem 3 · Both Sides of the Comparison
Given:A=⟨3,4⟩, B=⟨5,0⟩ and C=A−B, so that ∣A∣=∣B∣=5 — find∣C∣2 and the cosine of the angle θ between A and B.
What is ∣C∣2?
What is cosθ?
✅ Correct! Components give ∣C∣2=20, and the law of cosines gives 25+25−2(5)(5)53=50−30=20. The two computations meet, exactly as the proof requires.
❌ That is Pythagoras alone.∣A∣2+∣B∣2=50 would be the answer if θ were a right angle. Here A⋅B=15=0, so the correction term −2A⋅B=−30 still has to be subtracted.
❌ Wrong sign on the correction.80=25+25+2(15). The expansion of (A−B)⋅(A−B) produces −A⋅B and −B⋅A, so the middle terms combine to −2A⋅B.
❌ That is ∣C∣, not ∣C∣2.C=⟨−2,4⟩ has length 20; the quantity both computations produce is its square, 20.
❌ Check ∣C∣2. Subtract componentwise first: C=⟨3−5,4−0⟩, then add the squares of its components.
❌ That is A⋅B itself. The theorem says A⋅B=∣A∣∣B∣cosθ, so the cosine is that number divided by the two lengths: 15/(5⋅5). A cosine can never exceed 1.
❌ That is sinθ.B lies along the x-axis, so θ is the polar angle of A=⟨3,4⟩: the adjacent component over the length is 3/5, and 4/5 is the opposite one.
❌ Wrong ratio.43 divides the two components of A against each other. The cosine divides the adjacent component by the length: 3/5. In dot-product form, A⋅B=15 over ∣A∣∣B∣=25.
❌ Check the cosine. Solve the theorem for it: cosθ=∣A∣∣B∣A⋅B, with A⋅B=15 and both lengths equal to 5.
Equivalently, in the dot-product form of the same line: 25+25−2(15)=20. The two routes to ∣C∣2 differ only in how the last term is written, and that difference is the theorem.
Problem 4 · No Components Given
Given:∣A∣=3, ∣B∣=4 and A⋅B=−6 — find∣A−B∣.
✅ Correct!9+16−2(−6)=25+12=37. The angle is obtuse (cosθ=−21, so θ=120°), and an obtuse angle makes the third side longer than Pythagoras would allow.
❌ That is the right-angle answer.9+16=5 assumes A⋅B=0. Here the dot product is −6, so the term −2A⋅B=+12 must be added.
❌ Sign slip on the correction.13=25−12 subtracts the correction term instead of applying it as written: −2A⋅B=−2(−6)=+12, so the squared length is 25+12=37.
❌ Lengths do not add.3+4=7 is the largest the third side could ever be, reached only if the two vectors pointed in exactly opposite directions (A⋅B=−12). Here A⋅B=−6.
❌ Not quite. Expand ∣A−B∣2=(A−B)⋅(A−B)=∣A∣2+∣B∣2−2A⋅B — every quantity on the right is given.
Show solution
No components are available, so use the expansion the proof produced — it needs only lengths and a dot product:
∣A−B∣2=(A−B)⋅(A−B)=∣A∣2+∣B∣2−2A⋅B
Substituting the given values:
∣A−B∣2=32+42−2(−6)=9+16+12=37,∣A−B∣=37≈6.08
Cross-check with the law of cosines. The theorem gives