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

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

IKey Formulas

FormulaNameWhat you need
A⃗⋅B⃗=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
A⃗⋅B⃗=∣A⃗∣ ∣B⃗∣cos⁡θ\vec{A} \cdot \vec{B} = |\vec{A}|\,|\vec{B}|\cos\thetaThe theorem (geometric form)Both lengths and the angle between them
A⃗⋅A⃗=∣A⃗∣2=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 cos⁡0=1\cos 0 = 1
∣C⃗∣2=∣A⃗∣2+∣B⃗∣2−2∣A⃗∣ ∣B⃗∣cos⁡θ|\vec{C}|^2 = |\vec{A}|^2 + |\vec{B}|^2 - 2|\vec{A}|\,|\vec{B}|\cos\thetaLaw of cosines, with C⃗=A⃗−B⃗\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 ∣C⃗∣2|\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 ∣A⃗∣∣B⃗∣cos⁡θ|\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 ∣A⃗∣2+∣B⃗∣2|\vec{A}|^2 + |\vec{B}|^2; the angle alone decides what must be subtracted.

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

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

1 · the third side

C⃗=A⃗−B⃗\vec{C} = \vec{A} - \vec{B}

💡 Lines 2–4 contain no cosine anywhere; the expansion simply ends on A⃗⋅B⃗\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 \rangle — find A⃗⋅B⃗\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, 8−5−6=−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:

A⃗⋅B⃗=(2)(4)+(−1)(5)+(3)(−2)=8−5−6=−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 A⃗⋅B⃗=∣A⃗∣∣B⃗∣cos⁡θ\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 \rangle — find A⃗⋅A⃗\vec{A} \cdot \vec{A}.

✅ Correct! 1+4+4=9=∣A⃗∣21 + 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 A⃗⋅A⃗\vec{A}\cdot\vec{A}. The length is 1+4+4=3\sqrt{1 + 4 + 4} = 3, so A⃗⋅A⃗=∣A⃗∣2=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 cos⁡0=1\cos 0 = 1, but the formula still carries the two lengths: ∣A⃗∣∣A⃗∣cos⁡0=9⋅1=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:

A⃗⋅A⃗=(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

A⃗⋅A⃗=∣A⃗∣ ∣A⃗∣cos⁡0=∣A⃗∣2\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 ∣A⃗∣2=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 ∣C⃗∣2=C⃗⋅C⃗|\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⃗=A⃗−B⃗\vec{C} = \vec{A} - \vec{B}, so that ∣A⃗∣=∣B⃗∣=5|\vec{A}| = |\vec{B}| = 5 — find ∣C⃗∣2|\vec{C}|^2 and the cosine of the angle θ\theta between A⃗\vec{A} and B⃗\vec{B}.

What is ∣C⃗∣2|\vec{C}|^2?

What is cos⁡θ\cos\theta?

✅ Correct! Components give ∣C⃗∣2=20|\vec{C}|^2 = 20, and the law of cosines gives 25+25−2(5)(5)35=50−30=2025 + 25 - 2(5)(5)\tfrac{3}{5} = 50 - 30 = 20. The two computations meet, exactly as the proof requires.
❌ That is Pythagoras alone. ∣A⃗∣2+∣B⃗∣2=50|\vec{A}|^2 + |\vec{B}|^2 = 50 would be the answer if θ\theta were a right angle. Here A⃗⋅B⃗=15≠0\vec{A}\cdot\vec{B} = 15 \neq 0, so the correction term −2 A⃗⋅B⃗=−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 (A⃗−B⃗)⋅(A⃗−B⃗)(\vec{A}-\vec{B})\cdot(\vec{A}-\vec{B}) produces −A⃗⋅B⃗-\vec{A}\cdot\vec{B} and −B⃗⋅A⃗-\vec{B}\cdot\vec{A}, so the middle terms combine to −2 A⃗⋅B⃗-2\,\vec{A}\cdot\vec{B}.
❌ That is ∣C⃗∣|\vec{C}|, not ∣C⃗∣2|\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 ∣C⃗∣2|\vec{C}|^2. Subtract componentwise first: C⃗=⟨3−5, 4−0⟩\vec{C} = \langle 3-5,\, 4-0 \rangle, then add the squares of its components.
❌ That is A⃗⋅B⃗\vec{A}\cdot\vec{B} itself. The theorem says A⃗⋅B⃗=∣A⃗∣∣B⃗∣cos⁡θ\vec{A}\cdot\vec{B} = |\vec{A}||\vec{B}|\cos\theta, so the cosine is that number divided by the two lengths: 15/(5⋅5)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, A⃗⋅B⃗=15\vec{A}\cdot\vec{B} = 15 over ∣A⃗∣∣B⃗∣=25|\vec{A}||\vec{B}| = 25.
❌ Check the cosine. Solve the theorem for it: cos⁡θ=A⃗⋅B⃗∣A⃗∣ ∣B⃗∣\cos\theta = \dfrac{\vec{A}\cdot\vec{B}}{|\vec{A}|\,|\vec{B}|}, with A⃗⋅B⃗=15\vec{A}\cdot\vec{B} = 15 and both lengths equal to 55.
Show solution

Step 1 — the third side, from components.

C⃗=A⃗−B⃗=⟨3−5, 4−0⟩=⟨−2,4⟩,∣C⃗∣2=(−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.

A⃗⋅B⃗=(3)(5)+(4)(0)=15,cos⁡θ=A⃗⋅B⃗∣A⃗∣ ∣B⃗∣=155⋅5=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.

∣C⃗∣2=∣A⃗∣2+∣B⃗∣2−2∣A⃗∣ ∣B⃗∣cos⁡θ=25+25−2(5)(5)35=50−30=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+25−2(15)=2025 + 25 - 2(15) = 20. The two routes to ∣C⃗∣2|\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 A⃗⋅B⃗=−6\vec{A}\cdot\vec{B} = -6 — find ∣A⃗−B⃗∣|\vec{A} - \vec{B}|.

✅ Correct! 9+16−2(−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 A⃗⋅B⃗=0\vec{A}\cdot\vec{B} = 0. Here the dot product is −6-6, so the term −2 A⃗⋅B⃗=+12-2\,\vec{A}\cdot\vec{B} = +12 must be added.
❌ Sign slip on the correction. 13=25−1213 = 25 - 12 subtracts the correction term instead of applying it as written: −2 A⃗⋅B⃗=−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 (A⃗⋅B⃗=−12\vec{A}\cdot\vec{B} = -12). Here A⃗⋅B⃗=−6\vec{A}\cdot\vec{B} = -6.
❌ Not quite. Expand ∣A⃗−B⃗∣2=(A⃗−B⃗)⋅(A⃗−B⃗)=∣A⃗∣2+∣B⃗∣2−2 A⃗⋅B⃗|\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:

∣A⃗−B⃗∣2=(A⃗−B⃗)⋅(A⃗−B⃗)=∣A⃗∣2+∣B⃗∣2−2 A⃗⋅B⃗|\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:

∣A⃗−B⃗∣2=32+42−2(−6)=9+16+12=37,∣A⃗−B⃗∣=37≈6.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⁡θ=A⃗⋅B⃗∣A⃗∣ ∣B⃗∣=−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 ∣A⃗−B⃗∣2=9+16−2(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, −2 A⃗⋅B⃗-2\,\vec{A}\cdot\vec{B} and −2∣A⃗∣∣B⃗∣cos⁡θ-2|\vec{A}||\vec{B}|\cos\theta, are interchangeable — that interchange is the theorem.

Solved: 0 / 4