mathematics

Law Of Cosines: Formulas, Proofs, And Practical Applications

When working with right angled triangles, the Pythagorean theorem offers a straightforward way to find missing side lengths. However, real world measurements rarely present right angles. When you enco

Law Of Cosines: Formulas, Proofs, And Practical Applications
In this story

When working with right-angled triangles, the Pythagorean theorem offers a straightforward way to find missing side lengths. However, real-world measurements rarely present right angles. When you encounter acute or obtuse triangles where only side lengths or a mix of sides and angles are known, standard trigonometric ratios fall short. This is where the law of cosines becomes essential. It generalizes the Pythagorean theorem for any triangle, bridging the gap between geometry and trigonometry.

Understanding this formula allows you to solve for unknown dimensions in surveying, navigation, and physics without needing a perpendicular reference line.


Core Formula and Geometric Derivation

The law of cosines states that for any triangle with sides $a$, $b$, and $c$, and corresponding opposite angles $A$, $B$, and $C$:

$$c^2 = a^2 + b^2 - 2ab \cos(C)$$

You can rearrange this equation depending on which side or angle you need to find:

$$a^2 = b^2 + c^2 - 2bc \cos(A)$$ $$b^2 = a^2 + c^2 - 2ac \cos(B)$$

Notice how the structure mirrors the Pythagorean theorem ($c^2 = a^2 + b^2$). The final term, $-2ab \cos(C)$, acts as a geometric correction factor. When angle $C$ is exactly $90^\circ$, its cosine is zero, and the entire expression simplifies neatly back into the Pythagorean theorem.

Understanding the Proof via Coordinate Geometry

To see why this formula works, place a triangle on a coordinate plane. Let vertex $C$ sit at the origin $(0, 0)$. Let side $b$ lie along the positive x-axis, placing vertex $A$ at coordinates $(b, 0)$. Vertex $B$ then sits at $(a \cos(C), a \sin(C))$.

Using the distance formula to find the squared distance $c$ between vertex $A(b, 0)$ and vertex $B$:

$$c^2 = (a \cos(C) - b)^2 + (a \sin(C) - 0)^2$$

Expand the binomial:

$$c^2 = a^2 \cos^2(C) - 2ab \cos(C) + b^2 + a^2 \sin^2(C)$$

Factor out $a^2$ from the squared trigonometric terms:

$$c^2 = a^2 (\cos^2(C) + \sin^2(C)) + b^2 - 2ab \cos(C)$$

Since the Pythagorean trigonometric identity establishes that $\cos^2(C) + \sin^2(C) = 1$, the equation simplifies directly to:

$$c^2 = a^2 + b^2 - 2ab \cos(C)$$


When to Use the Law of Cosines

Knowing when to apply this formula prevents wasted calculation time. Geometry problems generally fall into specific known configurations. You should reach for the law of cosines in two primary scenarios:

  • Side-Angle-Side (SAS): You know two sides and the included angle between them. The formula computes the third side directly.
  • Side-Side-Side (SSS): You know all three sides of a triangle, but no angles. You can rearrange the formula to solve for any angle.

Solving an SAS Problem

For example, suppose you have a triangle where side $a = 7$ units, side $b = 10$ units, and the included angle $C = 60^\circ$. Find side $c$.

  1. Substitute values into the formula: $$c^2 = 7^2 + 10^2 - 2(7)(10) \cos(60^\circ)$$
  2. Compute the squares and products: $$c^2 = 49 + 100 - 140(0.5)$$
  3. Simplify: $$c^2 = 149 - 70 = 79$$
  4. Take the square root: $$c = \sqrt{79} \approx 8.89 \text{ units}$$

Solving an SSS Problem

When all three sides are known, rearrange the formula to isolate the cosine of an angle:

$$\cos(A) = \frac{b^2 + c^2 - a^2}{2bc}$$

For example, given a triangle with sides $a = 5$, $b = 7$, and $c = 10$, find angle $A$.

$$\cos(A) = \frac{7^2 + 10^2 - 5^2}{2(7)(10)}$$ $$\cos(A) = \frac{49 + 100 - 25}{140} = \frac{124}{140} \approx 0.8857$$ $$A = \arccos(0.8857) \approx 27.65^\circ$$

For deeper mathematical explorations and reference formulas, you can review resources provided by MathWorld or explore foundational proofs archived via Project Gutenberg.


Comparison: Law of Cosines vs. Law of Sines

Students often wonder whether to use the law of sines or the law of cosines. Choosing the right tool depends on your initial known values.

Scenario Recommended Tool Why?
Side-Angle-Side (SAS) Law of Cosines You cannot use the law of sines initially because no opposite side-angle pair is complete.
Side-Side-Side (SSS) Law of Cosines Directly yields any interior angle without ambiguity.
Angle-Side-Angle (ASA) Law of Sines A complete side-angle pair is available, and finding the third angle is trivial.
Side-Side-Angle (SSA) Law of Sines Can trigger the ambiguous case (zero, one, or two possible triangles), requiring careful checking.

Common Pitfalls and Calculation Mistakes

Even experienced math students run into avoidable errors when applying trigonometric laws. Keep these precautions in mind:

  • Order of Operations: In equations like $c^2 = a^2 + b^2 - 2ab \cos(C)$, students often subtract $2ab$ before multiplying by $\cos(C)$. Always evaluate the entire multiplication term ($2ab \cos(C)$) as a single block before subtraction.
  • Calculator Mode Settings: Ensure your calculator is set to degrees or radians, matching the units of your angle input. Accidentally evaluating in radians when given degrees yields wildly incorrect outputs.
  • Forgetting the Ambiguous SSS Check: When finding angles via inverse cosine, remember that the range of $\arccos$ is $0^\circ$ to $180^\circ$, which correctly handles both acute and obtuse triangle angles.

Frequently Asked Questions

Can the law of cosines be used on right-angled triangles?

Yes. While unnecessary since the Pythagorean theorem and basic ratios are faster, the law of cosines still works. Because the cosine of $90^\circ$ is zero, the trailing term vanishes, leaving the standard Pythagorean equation.

👉 See also: this article

What happens if the cosine calculation results in a negative number?

A negative cosine value simply indicates that the angle is obtuse (greater than $90^\circ$). This is completely normal when solving SSS problems where one angle is wide.

How do I know if a triangle has no solution?

When using the law of cosines to find a side, you'll get real numbers. However, when solving for angles via inverse cosine, if your fraction numerator exceeds the denominator (resulting in a value greater than $1$ or less than $-1$), no such triangle can physically exist.

Is the law of cosines restricted to flat Euclidean geometry?

Yes. The standard formulation applies strictly to flat planes. Spherical trigonometry requires adjusted formulas to account for curvature, which is critical in global navigation and astronomy.

IC

Written by

Isabella Carter

As a veteran correspondent, Isabella Carter has reported from across the globe, bringing firsthand perspectives to international stories and local issues.

More from mathematics