Multivariable-Calculus · Unit 1 · Video 3 · Interactive Practice

The Dot Product: Componentwise Definition and the Law of Cosines Proof

IKey Formulas

FormulaNameWhat you need
AB=a1b1+a2b2+a3b3\vec{A} \cdot \vec{B} = a_1 b_1 + a_2 b_2 + a_3 b_3Componentwise definitionThe components of both vectors
AB=ABcosθ\vec{A} \cdot \vec{B} = |\vec{A}|\,|\vec{B}|\cos\thetaThe theorem (geometric form)Both lengths and the angle between them
AA=A2=a12+a22+a32\vec{A} \cdot \vec{A} = |\vec{A}|^2 = a_1^2 + a_2^2 + a_3^2Step 1 of the proofθ=0\theta = 0, and cos0=1\cos 0 = 1
C2=A2+B22ABcosθ|\vec{C}|^2 = |\vec{A}|^2 + |\vec{B}|^2 - 2|\vec{A}|\,|\vec{B}|\cos\thetaLaw of cosines, with C=AB\vec{C} = \vec{A} - \vec{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 C2|\vec{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 ABcosθ|\vec{A}||\vec{B}|\cos\theta return the same number for every pair of arrows.

💡 Swapping A\vec{A} and B\vec{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 A2+B2|\vec{A}|^2 + |\vec{B}|^2; the angle alone decides what must be subtracted.

IVVisualization 3 — Two Computations of C2|\vec{C}|^2

The algebraic expansion and the law of cosines agree in every term but the last.

1 · the third side

C=AB\vec{C} = \vec{A} - \vec{B}

💡 Lines 2–4 contain no cosine anywhere; the expansion simply ends on AB\vec{A}\cdot\vec{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\vec{A} = \langle 2, -1, 3 \rangle and B=4,5,2\vec{B} = \langle 4, 5, -2 \ranglefind AB\vec{A} \cdot \vec{B}.

✅ Correct! 8+(5)+(6)=38 + (-5) + (-6) = -3. The negative sign already says something geometric: cosθ<0\cos\theta < 0, so the angle between these two vectors is obtuse.
❌ Signs dropped. 19=8+5+619 = 8 + 5 + 6 treats every product as positive. Two of the three products are negative here: (1)(5)=5(-1)(5) = -5 and (3)(2)=6(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(3)(-2) = -6, not +6+6. With the correct sign, 856=38 - 5 - 6 = -3.
❌ Not quite. Multiply matching components and add: (2)(4)+(1)(5)+(3)(2)(2)(4) + (-1)(5) + (3)(-2).
Show solution

Apply the componentwise definition, one matching pair at a time:

AB=(2)(4)+(1)(5)+(3)(2)=856=3\vec{A}\cdot\vec{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 AB=ABcosθ\vec{A}\cdot\vec{B} = |\vec{A}||\vec{B}|\cos\theta and lengths are positive, a negative dot product means cosθ<0\cos\theta < 0.

Problem 2 · A Vector With Itself

Given: A=1,2,2\vec{A} = \langle 1, -2, 2 \ranglefind AA\vec{A} \cdot \vec{A}.

✅ Correct! 1+4+4=9=A21 + 4 + 4 = 9 = |\vec{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=91 + 4 + 4 = 9.
❌ That is A|\vec{A}|, not AA\vec{A}\cdot\vec{A}. The length is 1+4+4=3\sqrt{1 + 4 + 4} = 3, so AA=A2=9\vec{A}\cdot\vec{A} = |\vec{A}|^2 = 9 — the square root is exactly what does not get taken here.
❌ Only one factor. The angle between A\vec{A} and itself is 00 and cos0=1\cos 0 = 1, but the formula still carries the two lengths: AAcos0=91=9|\vec{A}||\vec{A}|\cos 0 = 9 \cdot 1 = 9.
❌ Not quite. Dot the vector with itself componentwise: (1)(1)+(2)(2)+(2)(2)(1)(1) + (-2)(-2) + (2)(2).
Show solution

From the definition:

AA=(1)(1)+(2)(2)+(2)(2)=1+4+4=9\vec{A}\cdot\vec{A} = (1)(1) + (-2)(-2) + (2)(2) = 1 + 4 + 4 = 9

From the geometry: the angle between A\vec{A} and itself is 00, so

AA=AAcos0=A2\vec{A}\cdot\vec{A} = |\vec{A}|\,|\vec{A}|\cos 0 = |\vec{A}|^2

and indeed A=1+4+4=3|\vec{A}| = \sqrt{1+4+4} = 3, giving A2=9|\vec{A}|^2 = 9. The two routes agree — that agreement is step 1 of the theorem's proof, and it is what licenses writing C2=CC|\vec{C}|^2 = \vec{C}\cdot\vec{C} in step 2.

Problem 3 · Both Sides of the Comparison

Given: A=3,4\vec{A} = \langle 3, 4 \rangle, B=5,0\vec{B} = \langle 5, 0 \rangle and C=AB\vec{C} = \vec{A} - \vec{B}, so that A=B=5|\vec{A}| = |\vec{B}| = 5find C2|\vec{C}|^2 and the cosine of the angle θ\theta between A\vec{A} and B\vec{B}.

What is C2|\vec{C}|^2?

What is cosθ\cos\theta?

✅ Correct! Components give C2=20|\vec{C}|^2 = 20, and the law of cosines gives 25+252(5)(5)35=5030=2025 + 25 - 2(5)(5)\tfrac{3}{5} = 50 - 30 = 20. The two computations meet, exactly as the proof requires.
❌ That is Pythagoras alone. A2+B2=50|\vec{A}|^2 + |\vec{B}|^2 = 50 would be the answer if θ\theta were a right angle. Here AB=150\vec{A}\cdot\vec{B} = 15 \neq 0, so the correction term 2AB=30-2\,\vec{A}\cdot\vec{B} = -30 still has to be subtracted.
❌ Wrong sign on the correction. 80=25+25+2(15)80 = 25 + 25 + 2(15). The expansion of (AB)(AB)(\vec{A}-\vec{B})\cdot(\vec{A}-\vec{B}) produces AB-\vec{A}\cdot\vec{B} and BA-\vec{B}\cdot\vec{A}, so the middle terms combine to 2AB-2\,\vec{A}\cdot\vec{B}.
❌ That is C|\vec{C}|, not C2|\vec{C}|^2. C=2,4\vec{C} = \langle -2, 4 \rangle has length 20\sqrt{20}; the quantity both computations produce is its square, 2020.
❌ Check C2|\vec{C}|^2. Subtract componentwise first: C=35,40\vec{C} = \langle 3-5,\, 4-0 \rangle, then add the squares of its components.
❌ That is AB\vec{A}\cdot\vec{B} itself. The theorem says AB=ABcosθ\vec{A}\cdot\vec{B} = |\vec{A}||\vec{B}|\cos\theta, so the cosine is that number divided by the two lengths: 15/(55)15 / (5 \cdot 5). A cosine can never exceed 11.
❌ That is sinθ\sin\theta. B\vec{B} lies along the xx-axis, so θ\theta is the polar angle of A=3,4\vec{A} = \langle 3, 4 \rangle: the adjacent component over the length is 3/53/5, and 4/54/5 is the opposite one.
❌ Wrong ratio. 34\tfrac{3}{4} divides the two components of A\vec{A} against each other. The cosine divides the adjacent component by the length: 3/53/5. In dot-product form, AB=15\vec{A}\cdot\vec{B} = 15 over AB=25|\vec{A}||\vec{B}| = 25.
❌ Check the cosine. Solve the theorem for it: cosθ=ABAB\cos\theta = \dfrac{\vec{A}\cdot\vec{B}}{|\vec{A}|\,|\vec{B}|}, with AB=15\vec{A}\cdot\vec{B} = 15 and both lengths equal to 55.
Show solution

Step 1 — the third side, from components.

C=AB=35, 40=2,4,C2=(2)2+42=20\vec{C} = \vec{A} - \vec{B} = \langle 3 - 5,\ 4 - 0 \rangle = \langle -2, 4 \rangle, \qquad |\vec{C}|^2 = (-2)^2 + 4^2 = 20

Step 2 — the dot product and the cosine.

AB=(3)(5)+(4)(0)=15,cosθ=ABAB=1555=35\vec{A}\cdot\vec{B} = (3)(5) + (4)(0) = 15, \qquad \cos\theta = \frac{\vec{A}\cdot\vec{B}}{|\vec{A}|\,|\vec{B}|} = \frac{15}{5 \cdot 5} = \frac{3}{5}

Step 3 — the law of cosines, as a check.

C2=A2+B22ABcosθ=25+252(5)(5)35=5030=20 |\vec{C}|^2 = |\vec{A}|^2 + |\vec{B}|^2 - 2|\vec{A}|\,|\vec{B}|\cos\theta = 25 + 25 - 2(5)(5)\tfrac{3}{5} = 50 - 30 = 20\ \checkmark

Equivalently, in the dot-product form of the same line: 25+252(15)=2025 + 25 - 2(15) = 20. The two routes to C2|\vec{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|\vec{A}| = 3, B=4|\vec{B}| = 4 and AB=6\vec{A}\cdot\vec{B} = -6find AB|\vec{A} - \vec{B}|.

✅ Correct! 9+162(6)=25+12=379 + 16 - 2(-6) = 25 + 12 = 37. The angle is obtuse (cosθ=12\cos\theta = -\tfrac{1}{2}, so θ=120°\theta = 120\degree), and an obtuse angle makes the third side longer than Pythagoras would allow.
❌ That is the right-angle answer. 9+16=5\sqrt{9 + 16} = 5 assumes AB=0\vec{A}\cdot\vec{B} = 0. Here the dot product is 6-6, so the term 2AB=+12-2\,\vec{A}\cdot\vec{B} = +12 must be added.
❌ Sign slip on the correction. 13=251213 = 25 - 12 subtracts the correction term instead of applying it as written: 2AB=2(6)=+12-2\,\vec{A}\cdot\vec{B} = -2(-6) = +12, so the squared length is 25+12=3725 + 12 = 37.
❌ Lengths do not add. 3+4=73 + 4 = 7 is the largest the third side could ever be, reached only if the two vectors pointed in exactly opposite directions (AB=12\vec{A}\cdot\vec{B} = -12). Here AB=6\vec{A}\cdot\vec{B} = -6.
❌ Not quite. Expand AB2=(AB)(AB)=A2+B22AB|\vec{A}-\vec{B}|^2 = (\vec{A}-\vec{B})\cdot(\vec{A}-\vec{B}) = |\vec{A}|^2 + |\vec{B}|^2 - 2\,\vec{A}\cdot\vec{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:

AB2=(AB)(AB)=A2+B22AB|\vec{A}-\vec{B}|^2 = (\vec{A}-\vec{B})\cdot(\vec{A}-\vec{B}) = |\vec{A}|^2 + |\vec{B}|^2 - 2\,\vec{A}\cdot\vec{B}

Substituting the given values:

AB2=32+422(6)=9+16+12=37,AB=376.08|\vec{A}-\vec{B}|^2 = 3^2 + 4^2 - 2(-6) = 9 + 16 + 12 = 37, \qquad |\vec{A}-\vec{B}| = \sqrt{37} \approx 6.08

Cross-check with the law of cosines. The theorem gives

cosθ=ABAB=612=12,θ=120°\cos\theta = \frac{\vec{A}\cdot\vec{B}}{|\vec{A}|\,|\vec{B}|} = \frac{-6}{12} = -\frac{1}{2}, \qquad \theta = 120\degree AB2=9+162(3)(4)(12)=25+12=37 |\vec{A}-\vec{B}|^2 = 9 + 16 - 2(3)(4)\left(-\tfrac{1}{2}\right) = 25 + 12 = 37\ \checkmark

The two forms of the last term, 2AB-2\,\vec{A}\cdot\vec{B} and 2ABcosθ-2|\vec{A}||\vec{B}|\cos\theta, are interchangeable — that interchange is the theorem.

Solved: 0 / 4