Mathematics.

oblique triangles

Law of Cosines

Trigonometry20 minDifficulty4 out of 10

You should know: trigonometric functions

Overview

The law of cosines generalizes the Pythagorean theorem to any triangle, not just right triangles. For a triangle with sides a, b, c opposite angles α, β, γ, it expresses the square of one side in terms of the other two sides and the cosine of their included angle. When the included angle is 90°, cos(90°) = 0 and the formula reduces exactly to the Pythagorean theorem. The law of cosines is used to solve triangles given SAS (two sides and the included angle) or SSS (three sides), cases the law of sines cannot handle directly.

Formal Definition

Definition

For a triangle with sides a, b, c opposite angles α, β, γ respectively, the law of cosines states (using angle γ opposite side c as the reference):

c2=a2+b22abcosγc^2 = a^2 + b^2 - 2ab\cos\gamma

Generalizes the Pythagorean theorem; reduces to c² = a² + b² when γ = 90°

Law of cosines
γ=arccos ⁣(a2+b2c22ab)\gamma = \arccos\!\left(\frac{a^2+b^2-c^2}{2ab}\right)

Solved for the angle, used in the SSS case

Worked Examples

  1. Substitute into the law of cosines with the included angle γ between sides a and b.

    c2=72+1022(7)(10)cos60=49+100140(0.5)c^2 = 7^2 + 10^2 - 2(7)(10)\cos 60^\circ = 49 + 100 - 140(0.5)
  2. Simplify.

    c2=14970=79    c=798.89c^2 = 149 - 70 = 79 \;\Rightarrow\; c = \sqrt{79} \approx 8.89

Answer: c ≈ 8.89

Practice Problems

Difficulty 4/10

A triangle has sides a = 8, b = 5, and included angle γ = 120°. Find side c.

Difficulty 5/10

A surveyor cannot measure across a pond directly. From a station, one shore point is 120 m away, the other 150 m away, and the angle between the two sightlines is 80°. How wide is the pond between the two points?

Difficulty 6/10

A triangular truss panel has members of length 3 m, 4 m, and 6 m. Find the angle opposite the 6 m member (to check the geometry).

Difficulty 5/10

A ship sails 40 km on one bearing, then turns and sails 30 km on a bearing that makes an interior angle of 120° with the first leg. How far is the ship from its starting point?

Common Mistakes

Common Mistake

Forgetting the minus sign, or writing c² = a² + b² + 2ab·cos(γ).

The correct form is c² = a² + b² − 2ab·cos(γ). When γ = 90°, cos(γ) = 0 and the formula must reduce to the Pythagorean theorem — use that as a sanity check.

Quiz

A surveyor knows two distances from a station to two points and the angle between the sightlines. To find the distance between the two points, use:
If solving cosθ = (a²+b²−c²)/(2ab) gives a NEGATIVE value, the angle θ is:

Summary

  • Law of cosines: c² = a² + b² − 2ab·cos(γ), where γ is the angle opposite side c.
  • Generalizes the Pythagorean theorem: setting γ = 90° recovers c² = a² + b².
  • Solves SAS (two sides + included angle) and SSS (three sides) triangle cases.
  • Solved for the angle: γ = arccos((a²+b²−c²)/(2ab)).

References