ArticleslgStudy

mathematics

Law of cosines

Law of cosines is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Law of cosines rather than just read about it. In short: In trigonometry, the law of cosines (also known as the cosine formula or cosine rule or Al-Kashi’s theorem) relates the lengths of the sides of a triangle to the cosine of one of its angles. For a triangle with sides ⁠ a {\displaystyle a} ⁠, ⁠ b {\displaystyle b} ⁠, and ⁠ c {\displaystyle c} ⁠, opposite respective angles ⁠ α {\displaystyle \alpha } ⁠, ⁠ β {\displaystyle \beta } ⁠, and ⁠ γ {\displaystyle \gamma } ⁠ (…

Law of cosines — main illustration
Law of cosines — illustration

Key takeaways

  • Law of cosines belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Law of cosines to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Law of cosines from memory before moving on to harder problems.

Reference excerpt

In trigonometry, the law of cosines (also known as the cosine formula or cosine rule or Al-Kashi’s theorem) relates the lengths of the sides of a triangle to the cosine of one of its angles. For a triangle with sides ⁠ a {\displaystyle a} ⁠, ⁠ b {\displaystyle b} ⁠, and ⁠ c {\displaystyle c} ⁠, opposite respective angles ⁠ α {\displaystyle \alpha } ⁠, ⁠ β {\displaystyle \beta } ⁠, and ⁠ γ {\displaystyle \gamma } ⁠ (see Fig. 1), the law of cosines states:

c 2 = a 2 + b 2 − 2 a b cos ⁡ γ , a 2 = b 2 + c 2 − 2 b c cos ⁡ α , b 2 = a 2 + c 2 − 2 a c cos ⁡ β . {\displaystyle {\begin{aligned}c^{2}&=a^{2}+b^{2}-2ab\cos \gamma ,\\[3mu]a^{2}&=b^{2}+c^{2}-2bc\cos \alpha ,\\[3mu]b^{2}&=a^{2}+c^{2}-2ac\cos \beta .\end{aligned}}}

The law of cosines generalizes the Pythagorean theorem, which holds only for right triangles: if ⁠ γ {\displaystyle \gamma } ⁠ is a right angle then ⁠ cos ⁡ γ = 0 {\displaystyle \cos \gamma =0} ⁠, and the law of cosines reduces to ⁠ c 2 = a 2 + b 2 {\displaystyle c^{2}=a^{2}+b^{2}} ⁠. The law of cosines is useful for solving a triangle when all three sides or two sides and their included angle are given.

Use in solving triangles

The theorem is used in solution of triangles, i.e., to find (see Figure 3):

the third side of a triangle if two sides and the angle between them is known: c = a 2 + b 2 − 2 a b cos ⁡ γ ; {\displaystyle c={\sqrt {a^{2}+b^{2}-2ab\cos \gamma }}\,;}

the angles of a triangle if the three sides are known: γ = arccos ⁡ ( a 2 + b 2 − c 2 2 a b ) ; {\displaystyle \gamma =\arccos \left({\frac {a^{2}+b^{2}-c^{2}}{2ab}}\right)\,;}

the third side of a triangle if two sides and an angle opposite to one of them is known (this side can also be found by two applications of the law of sines): a = b cos ⁡ γ ± c 2 − b 2 sin 2 ⁡ γ . {\displaystyle a=b\cos \gamma \pm {\sqrt {c^{2}-b^{2}\sin ^{2}\gamma }}\,.}

These formulas produce high round-off errors in floating point calculations if the triangle is very acute, i.e., if c is small relative to a and b or γ is small compared to 1. It is even possible to obtain a result slightly greater than one for the cosine of an angle. The third formula shown is the result of solving for a in the quadratic equation a2 − 2ab cos γ + b2 − c2 = 0. This equation can have 2, 1, or 0 positive solutions corresponding to the number of possible triangles given the data. It will have two positive solutions if b sin γ < c < b, only one positive solution if c = b sin γ, and no solution if c < b sin γ. These different cases are also explained by the side-side-angle congruence ambiguity.

… excerpt ends here. Continue reading the full article.

Illustrations

Law of cosines: Fig. 1 – A triangle. The angles α (or A), β (or B), and γ (or C) are respectively opposite the sides a, b, and c.
Fig. 1 – A triangle. The angles α (or A), β (or B), and γ (or C) are respectively opposite the sides a, b, and c.
Law of cosines: Fig. 3 – Applications of the law of cosines: unknown side and unknown angle.
Fig. 3 – Applications of the law of cosines: unknown side and unknown angle.
Law of cosines: Given triangle sides b and c and angle γ there are sometimes two solutions for a.
Given triangle sides b and c and angle γ there are sometimes two solutions for a.
Law of cosines: Fig. 2 – Obtuse triangle ABC with perpendicular BH
Fig. 2 – Obtuse triangle ABC with perpendicular BH
Law of cosines: Al-Kashi's version of the law of cosines (case where γ is obtuse), expressed with modern algebraic notation.
Al-Kashi's version of the law of cosines (case where γ is obtuse), expressed with modern algebraic notation.

Worked examples

Example 1 — a first encounter with Law of cosines

Start with the simplest possible case. Write down what Law of cosines claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Law of cosines before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Law of cosines ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Law of cosines

In research
Law of cosines appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Law of cosines in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Law of cosines is common in secondary-school and first-year university syllabi. It links to neighbouring topics Angle, Theorems about triangles, Trigonometry, so understanding it makes those chapters shorter.
In everyday life
Look for Law of cosines outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Law of cosines in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Law of cosines means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Law of cosines out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Law of cosines in simple terms?

In trigonometry, the law of cosines (also known as the cosine formula or cosine rule or Al-Kashi’s theorem) relates the lengths of the sides of a triangle to the cosine of one of its angles. For a triangle with sides ⁠ a {\displaystyle a} ⁠, ⁠ b {\displaystyle b} ⁠, and ⁠ c {\displaystyle c} ⁠, opp…

Why does Law of cosines matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Law of cosines?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Law of cosines.

Tags

  • Angle
  • Theorems about triangles
  • Trigonometry

Keep exploring