Math Trigonometry Law of cosines

Law of cosines

The cosine rule is applicable in any triangle, if either

  • three sides
  • or
  • two sides and the (included) angle are given.

In the second case, the angle cannot be opposite to either of the two given sides. Otherwise, you need the sine rule.

In triangle ABC, the cosine rule says:

  • $a^2=b^2+c^2-2bc\cdot\cos(\alpha)$

  • $b^2=a^2+c^2-2ac\cdot\cos(\beta)$

  • $c^2=a^2+b^2-2ab\cdot\cos(\gamma)$


Given is a triangle with $a=7$, $c=4$ and $\beta=89^\circ$. Calculate the $b$.

  1. Find the right formula

  2. Insert and calculate