What is the most elegant and simple proof for the law of cosines? Given 2 sides, and an angle between those two sides, what is the simplest proof you can come up with to find the measure of the 3rd side?
 A: Here's a proof similar to the dot product proof in previous answers, but using complex numbers and Euler's formula:
$$
  |a-b|^2 = (a-b) \overline{(a-b)} = a \overline{a} + b \overline{b} - (\overline{a} b + a \overline{b}) = \\
|a|^2 + |b|^2 - |a||b|(e^{i(\arg{b} - \arg{a})} + e^{i(\arg{a} - \arg{b})}) = \\  |a|^2 + |b|^2 - 2|a||b|\cos{\theta}
$$
A: $\hspace{5cm}$ Using Properties of the Dot Product
$\hspace{4.5cm}$
$$
\begin{align}
|a-b|^2
&=(a-b)\cdot(a-b)\\
&=a\cdot a+b\cdot b-2\,a\cdot b\\
&=|a|^2+|b|^2-2|a||b|\cos(\theta)
\end{align}
$$
Justification of $\mathbf{a\cdot b=|a||b|cos(\theta)}$:
Using the formula for the cosine of a difference, we have
$$
\begin{align}
a\cdot b
&=|a|\left(\cos(\alpha),\sin(\alpha)\right) \cdot |b|\left(\cos(\beta),\sin(\beta)\right)\\
&=|a||b|\left(\cos(\alpha)\cos(\beta)+\sin(\alpha)\sin(\beta)\right)\\
&=|a||b|\cos(\alpha-\beta)\\
\end{align}
$$

$\hspace{5cm}$ Using the Pythagorean Theorem
$\hspace{2cm}$
$$
\begin{align}
c^2
&=(b\cos(\theta)-a)^2+(b\sin(\theta))^2\\
&=a^2+b^2(\sin^2(\theta)+\cos^2(\theta))-2ab\cos(\theta)\\
&=a^2+b^2-2ab\cos(\theta)
\end{align}
$$
A: Here is my take. Consider the formula and the following picture:
$$ {\color{darkgreen}{c^2}} = {\color{red}{a^2} + \color{darkorange}{b^2}} - {\color{darkgreen}{2ab\cos\theta}} $$
$\hspace{90pt}$
The yellow vectors are precisely $a$ and $b$, where $a > b$. The only tricky point is that the area of two small red squares sums up to the orange square (so that the big red square $\color{red}{a^2}$ does not overlap with the smaller orange $\color{darkorange}{b^2}$ one), but this is due the blue triangle and Pythagorean theorem. Of course one should not forget to apply Pythagorean theorem also to (big green square) = (orange square) + (middle red square), after this it's just a rearrangement of the rest.
Cheers!
A: Let our triangle (with side lengths $a$, $b$, $c$, and angle $\gamma$ opposite $c$) be embedded in $\mathbb{C}$ so that the side with length $a$ lies on the real axis and the vertex with angle $\gamma$ lies on the origin.  Let $b$ be the complex number corresponding to the side with length $b$.  Observe that the side with length $c$ may be represented as $b - a$.  Then we have 
$$\|c\|^2 = (b-a)^2 = (b_x - a)^2 + (b_y)^2 = a^2 + (b_x^2 + b_y^2) - 2ab_x.$$
But by Euler's formula, $b=\cos\gamma + i\sin\gamma$, so $b_x = \cos\gamma$, so we have 

$$c^2 = a^2 + b^2 - 2ab\cos\gamma.$$

A: As others have pointed out, if you know the "dot product",
and ALSO, some properties of it, then you can show the relation
that determines the size of the third side.
What remains to be shown, are these properties of the dot product.
Suppose that you know that for
$a = \sum_i a_i e_i$ and $b = \sum_i b_i e_i$,
$a \cdot b = \sum_i a_i b_i$.
But you also know that
$a \cdot b = |a| |b| \cos \theta$.
Then, (as others have written)
$$
  \begin{align}
    |a-b|^2
    &=
    (a - b) \cdot (a - b)
    \\
    &=
    a \cdot a + b \cdot b - 2\, a \cdot b
    \\
    &=
    |a|^2 + |b|^2 - 2 |a| |b| \cos \theta.
  \end{align}
$$
But how do we know that
$|a| |b| \cos \theta = \sum_i a_i b_i$
in the first place?
I want to think about a related problem.
We have two vectors $a$ and $b$, and want to know the "size"
of the projection of $a$ in $b$'s direction $P_b(a)$.
If instead of "size", we think of a "signed size", that is,
if the projection has the same direction as $b$, then it is positive.
Otherwise, it is negative.
In other words,
$$
  P_b(a)
  =
  |a| \cos \theta.
$$
This set up is too loose.
We didn't define what we mean by "projection in a certain direction".
We didn't define $\theta$, and we didn't define $\cos \theta$!!
Let's start over...
For each vector $b$, we have a map $P_b: \mathbb{R}^n \to \mathbb{R}$ ("signed" size of the projection in $b$'s direction), such that:


*
  
*$P_b$ is linear. Convince yourself with a drawing... ;-)
  
*$P_{\alpha b} = \mathrm{sig}(\alpha) P_b$, where $\mathrm{sig}(\alpha)$ is the signal of $\alpha$.
  
*If $a$ and $b$ are unitary, then $P_b(a) = P_a(b)$.
  
*$P_{e_i}(e_j) = \delta_{ij}$, where $\delta_{ij}$ is the [Kronecker delta].
  
*$P_a(a) = |a|$.


Then, we want to show that
$$
  P_b(a) = \frac{1}{|b|} \sum_i a_i b_i.
$$
Applying properties "1", "2", "3", "1" and "4",
$$
  \begin{align}
    P_b(a)
    &=
    \sum_i a_i P_b(e_i)
    \\
    &=
    \sum_i a_i P_{\frac{b}{|b|}}(e_i)
    \\
    &=
    \sum_i a_i P_{e_i}\left(\frac{b}{|b|}\right)
    \\
    &=
    \frac{1}{|b|} \sum_{i,j} a_i b_j P_{e_j}(e_i)
    \\
    &=
    \frac{1}{|b|} \sum_i a_i b_i.
  \end{align}
$$
The fact that $P(a, b) = P_b(a)$ is not linear in $b$ made things
a bit more difficult to calculate.
For that reason, instead of $P_b(a)$, we use the
"dot product": $a \cdot b = |b| P_b(a)$.
