Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
1 – pedja Apr 25 '12 at 12:47
Wikipedia ( offers several different proofs. – Joel Cohen Apr 25 '12 at 12:47
I like the one using the Pythagorean theorem because it shows that the law of cosines is equivalent to the Pythagorean theorem. – lhf Apr 25 '12 at 13:15
I think the ordering by elegance and the ordering by simplicity are partial orders, not total orders. I'm sure there are plenty of maximal elements in the corresponding set, but I'm not sure there is a maximum (even if each of the orders is total, the product order is not...) (-; – Arturo Magidin Apr 25 '12 at 16:03

$\hspace{5cm}$ Using Properties of the Dot Product

$\hspace{4.5cm}$dot product diagram $$ \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}$pythagorean diagram

$$ \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} $$

share|cite|improve this answer
But why is $a\cdot b = |a||b|\cos \theta$? That's just pushing the proof to another basic theorem one would like to prove. – Thomas Andrews Apr 25 '12 at 13:17
@user8210: If this is the definition of dot product, then how do you know that $(a-b)\cdot(a-b) = a \cdot a + \dotsb$? All I get is $|a-b|^2 = (a-b) \cdot (a-b) = |a-b|^2 \cos \theta = |a-b|^2$. – André Caldas Apr 25 '12 at 14:13
Would the downvoter care to explain? – robjohn Apr 25 '12 at 15:35
Downvote explanation: Basically because of the comment due to @ThomasAndrews. It is very common to see students who think $(a+b,a+b) = (a,a) + (b,b)$ proves the Pytagorean Theorem. – André Caldas Apr 25 '12 at 15:43
@TenaliRaman: I guess things are hard for people to get to a consensus, because the definitions are not very clear. The OP itself is not very well defined because of this "lack of definition". The "properties" of the dot product are EXACTLY what needs to be proved. As on my preview comment, $(a+b,a+b) = (a,a) + (b,b)$ when $a$ and $b$ are "orthogonal" does not prove the Pytagorean Theorem. Things have equivalent definitions. IMO, the "equivalence" itself is what is at stake. – André Caldas Apr 25 '12 at 15:48

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}$law of cosines

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.


share|cite|improve this answer

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.$$

share|cite|improve this answer

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:

  1. $P_b$ is linear. Convince yourself with a drawing... ;-)
  2. $P_{\alpha b} = \mathrm{sig}(\alpha) P_b$, where $\mathrm{sig}(\alpha)$ is the signal of $\alpha$.
  3. If $a$ and $b$ are unitary, then $P_b(a) = P_a(b)$.
  4. $P_{e_i}(e_j) = \delta_{ij}$, where $\delta_{ij}$ is the [Kronecker delta].
  5. $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)$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.