## Problem on vectors and the law of cosines

Derive the law of cosines using the dot product:
(a) Write $\text{CB}$ in terms of $\text{OB}$ and $\text{OC}$
(b) Write $\left | \text{CB} \right|^2$ in terms of $\left | \text{OB} \right |$, $\left | \text{OC} \right |$ and $\text{OB} \cdot \text{OC}$
(c) Show that $\left | \text{CB} \right|^2 = \left | \text{OB} \right|^2 + \left | \text{OC} \right |^2 - 2 \left | \text{OB} \right| \left | \text{OC} \right| \cos \theta$.
• ## Solution

#### Part (a)

$\text{CB}$ refers to the vector from $\text{C}$ to $\text{B}$. Recall that
Similarly $\text{OB} = \text{B} - \text{O}$ and $\text{OC} = \text{C} - \text{O}$.
Subtracting, we observe, $\text{CB}$ = $\text{OB} - \text{OC}$.

#### Part (b)

Recall the relationship between vector length and dot products:
Using algebra and our computation that $\text{CB}$ = $\text{OB} - \text{OC}$,

#### Part (c)

Recall the relationship between dot product and the angle between vectors:
We use this formula to get $$\left | \text{CB} \right|^2 = \left | \text{OB} \right|^2 + \left | \text{OC} \right |^2 - 2 \left | \text{OB} \right| \left | \text{OC} \right| \cos \theta ,$$ which is the law of cosines.