TExcelTAD
Home › Pre-Calculus, Geometry & Trigonometry › Trigonometric Identities

Trigonometric Identities

An identity is an equation that holds for every value where both sides are defined. Trig identities let you rewrite an expression into a simpler or more useful form. This lesson collects the core identities, shows how to prove new ones by hand, and how to check them with code.

The core list

Everything here follows from the unit-circle definition and the sum formulas of the previous lesson.

Family Identities
Reciprocal csc⁡θ=1/sin⁡θ\csc\theta = 1/\sin\theta, sec⁡θ=1/cos⁡θ\sec\theta = 1/\cos\theta, cot⁡θ=1/tan⁡θ\cot\theta = 1/\tan\theta
Quotient tan⁡θ=sin⁡θ/cos⁡θ\tan\theta = \sin\theta / \cos\theta, cot⁡θ=cos⁡θ/sin⁡θ\cot\theta = \cos\theta / \sin\theta
Pythagorean sin⁡2θ+cos⁡2θ=1\sin^2\theta + \cos^2\theta = 1, 1+tan⁡2θ=sec⁡2θ1 + \tan^2\theta = \sec^2\theta, 1+cot⁡2θ=csc⁡2θ1 + \cot^2\theta = \csc^2\theta
Even / odd cos⁡(−θ)=cos⁡θ\cos(-\theta) = \cos\theta, sin⁡(−θ)=−sin⁡θ\sin(-\theta) = -\sin\theta, tan⁡(−θ)=−tan⁡θ\tan(-\theta) = -\tan\theta
Cofunction sin⁡(π/2−θ)=cos⁡θ\sin(\pi/2 - \theta) = \cos\theta, cos⁡(π/2−θ)=sin⁡θ\cos(\pi/2 - \theta) = \sin\theta, tan⁡(π/2−θ)=cot⁡θ\tan(\pi/2 - \theta) = \cot\theta
Periodicity sin⁡\sin and cos⁡\cos have period 2π2\pi, tan⁡\tan and cot⁡\cot have period π\pi
Double angle sin⁡2θ=2sin⁡θcos⁡θ\sin 2\theta = 2\sin\theta\cos\theta, cos⁡2θ=cos⁡2θ−sin⁡2θ\cos 2\theta = \cos^2\theta - \sin^2\theta
Power reduction sin⁡2θ=(1−cos⁡2θ)/2\sin^2\theta = (1 - \cos 2\theta)/2, cos⁡2θ=(1+cos⁡2θ)/2\cos^2\theta = (1 + \cos 2\theta)/2

The other two Pythagorean identities come from the first: divide sin⁡2θ+cos⁡2θ=1\sin^2\theta + \cos^2\theta = 1 by cos⁡2θ\cos^2\theta to get tan⁡2θ+1=sec⁡2θ\tan^2\theta + 1 = \sec^2\theta, or by sin⁡2θ\sin^2\theta to get 1+cot⁡2θ=csc⁡2θ1 + \cot^2\theta = \csc^2\theta.

Product-to-sum and sum-to-product

Adding and subtracting the sum and difference formulas gives:

sin⁡αcos⁡β=12[sin⁡(α+β)+sin⁡(α−β)]cos⁡αcos⁡β=12[cos⁡(α−β)+cos⁡(α+β)]sin⁡αsin⁡β=12[cos⁡(α−β)−cos⁡(α+β)]sin⁡A+sin⁡B=2sin⁡A+B2cos⁡A−B2cos⁡A+cos⁡B=2cos⁡A+B2cos⁡A−B2\begin{aligned} \sin\alpha\cos\beta &= \tfrac{1}{2}[\sin(\alpha + \beta) + \sin(\alpha - \beta)] \\ \cos\alpha\cos\beta &= \tfrac{1}{2}[\cos(\alpha - \beta) + \cos(\alpha + \beta)] \\ \sin\alpha\sin\beta &= \tfrac{1}{2}[\cos(\alpha - \beta) - \cos(\alpha + \beta)] \\[1ex] \sin A + \sin B &= 2\sin\frac{A + B}{2}\cos\frac{A - B}{2} \\ \cos A + \cos B &= 2\cos\frac{A + B}{2}\cos\frac{A - B}{2} \end{aligned}

For example, cos⁡(α−β)+cos⁡(α+β)=2cos⁡αcos⁡β\cos(\alpha - \beta) + \cos(\alpha + \beta) = 2\cos\alpha\cos\beta, because the sin⁡αsin⁡β\sin\alpha\sin\beta terms cancel. The second group is the first group read backwards with A=α+βA = \alpha + \beta and B=α−βB = \alpha - \beta. These formulas explain beats in sound: two close frequencies added together equal one fast wave times a slow envelope.

How to prove an identity

You prove an identity by transforming one side, step by step, until it becomes the other side. Do not start from the equation and do the same thing to both sides; that assumes what you want to prove.

Useful moves:

  1. Start with the more complicated side.
  2. Rewrite everything in sin⁡\sin and cos⁡\cos.
  3. Combine fractions over a common denominator.
  4. Look for sin⁡2+cos⁡2\sin^2 + \cos^2, or a factoring pattern such as a2−b2=(a−b)(a+b)a^2 - b^2 = (a - b)(a + b).
  5. Multiply by a "conjugate" such as (1+cos⁡θ)/(1+cos⁡θ)(1 + \cos\theta)/(1 + \cos\theta).

Example 1. Prove tan⁡θ+cot⁡θ=sec⁡θcsc⁡θ\tan\theta + \cot\theta = \sec\theta\csc\theta.

tan⁡θ+cot⁡θ=sin⁡θcos⁡θ+cos⁡θsin⁡θ=sin⁡2θ+cos⁡2θsin⁡θcos⁡θ=1sin⁡θcos⁡θ=1cos⁡θ⋅1sin⁡θ=sec⁡θcsc⁡θ■\begin{aligned} \tan\theta + \cot\theta &= \frac{\sin\theta}{\cos\theta} + \frac{\cos\theta}{\sin\theta} \\ &= \frac{\sin^2\theta + \cos^2\theta}{\sin\theta\cos\theta} \\ &= \frac{1}{\sin\theta\cos\theta} \\ &= \frac{1}{\cos\theta} \cdot \frac{1}{\sin\theta} = \sec\theta\csc\theta \qquad\blacksquare \end{aligned}

Example 2. Prove (1−cos⁡θ)/sin⁡θ=sin⁡θ/(1+cos⁡θ)(1 - \cos\theta)/\sin\theta = \sin\theta/(1 + \cos\theta).

1−cos⁡θsin⁡θ⋅1+cos⁡θ1+cos⁡θ=1−cos⁡2θsin⁡θ (1+cos⁡θ)=sin⁡2θsin⁡θ (1+cos⁡θ)=sin⁡θ1+cos⁡θ■\begin{aligned} &\frac{1 - \cos\theta}{\sin\theta} \cdot \frac{1 + \cos\theta}{1 + \cos\theta} \\ &\quad = \frac{1 - \cos^2\theta}{\sin\theta\,(1 + \cos\theta)} \\ &\quad = \frac{\sin^2\theta}{\sin\theta\,(1 + \cos\theta)} \\ &\quad = \frac{\sin\theta}{1 + \cos\theta} \qquad\blacksquare \end{aligned}

Both are true wherever the expressions are defined (sin⁡θ≠0\sin\theta \ne 0, cos⁡θ≠0\cos\theta \ne 0 in Example 1; sin⁡θ≠0\sin\theta \ne 0 in Example 2).

Checking identities with code

SymPy's simplify and trigsimp can often reduce left−right\text{left} - \text{right} to 0, which proves the identity symbolically. The same advice as by hand helps SymPy too: substitute sin⁡\sin and cos⁡\cos for tan⁡\tan, cot⁡\cot, sec⁡\sec and csc⁡\csc first. A numeric check at random points cannot prove anything, but it catches a false identity almost instantly, and it is how you would test a trig-heavy function in a real codebase:

python · try it yourself
import sympy as sp

t = sp.Symbol("theta")
to_sin_cos = {sp.tan(t): sp.sin(t) / sp.cos(t), sp.cot(t): sp.cos(t) / sp.sin(t),
              sp.sec(t): 1 / sp.cos(t), sp.csc(t): 1 / sp.sin(t)}
checks = {
    "tan + cot = sec·csc": sp.tan(t) + sp.cot(t) - sp.sec(t) * sp.csc(t),
    "(1-cos)/sin = sin/(1+cos)": (1 - sp.cos(t)) / sp.sin(t) - sp.sin(t) / (1 + sp.cos(t)),
    "sin^4 - cos^4 = -cos 2θ": sp.sin(t)**4 - sp.cos(t)**4 + sp.cos(2 * t),
}
for name, diff in checks.items():
    print(f"{name:28} simplify(left - right) = {sp.simplify(diff.subs(to_sin_cos))}")
tan + cot = sec·csc          simplify(left - right) = 0
(1-cos)/sin = sin/(1+cos)    simplify(left - right) = 0
sin^4 - cos^4 = -cos 2θ      simplify(left - right) = 0

Now a numeric, property-based style test, run on one true identity and one tempting false one:

python · try it yourself
import math
import random

rng = random.Random(7)

def holds(f, g, trials=1000):
    for _ in range(trials):
        x = rng.uniform(-10, 10)
        try:
            if not math.isclose(f(x), g(x), rel_tol=1e-9, abs_tol=1e-9):
                return f"fails at x = {x:.4f}: {f(x):.6f} vs {g(x):.6f}"
        except ZeroDivisionError:
            continue
    return "passes 1000 random tests"

print("1 + tan² = sec²   :", holds(lambda x: 1 + math.tan(x)**2, lambda x: 1 / math.cos(x)**2))
print("sin 2x = 2 sin x  :", holds(lambda x: math.sin(2 * x), lambda x: 2 * math.sin(x)))
1 + tan² = sec²   : passes 1000 random tests
sin 2x = 2 sin x  : fails at x = 9.0174: -0.727614 vs 0.792481

Note: simplify returning something other than 0 does not mean the identity is false; SymPy may just not find the route. Try trigsimp, expand_trig, or rewrite both sides with .rewrite(sp.cos). A numeric counterexample, on the other hand, really does disprove it.

In software

  • Avoiding expensive calls. sin⁡2θ\sin^2\theta from a known cos⁡θ\cos\theta is 1−cos⁡2θ1 - \cos^2\theta; graphics code often needs only one trig call per angle.
  • Numerical stability. 1−cos⁡θ1 - \cos\theta loses all precision for tiny θ\theta (it subtracts two nearly equal numbers). The identity 1−cos⁡θ=2sin⁡2(θ/2)1 - \cos\theta = 2\sin^2(\theta/2) gives the same value accurately. The haversine formula for map distances is built on exactly this rewrite (see Map Distances).
  • Testing. Identities make great test oracles: a correct rotate(v, a) must satisfy rotate(rotate(v, a), b) == rotate(v, a + b) up to rounding.
python · try it yourself
import math

theta = 1e-8
naive = 1 - math.cos(theta)
stable = 2 * math.sin(theta / 2) ** 2
print("1 - cos θ     :", naive)
print("2 sin²(θ/2)   :", stable)
print("true ≈ θ²/2   :", theta**2 / 2)
1 - cos θ     : 0.0
2 sin²(θ/2)   : 5.0000000000000005e-17
true ≈ θ²/2   : 5.0000000000000005e-17

Exercises

Exercise 1: Simplify

Simplify (sec⁡2θ−1)⋅cos⁡2θ(\sec^2\theta - 1) \cdot \cos^2\theta.

Answer

sin⁡2θ\sin^2\theta.

Solution
sec⁡2θ−1=tan⁡2θtan⁡2θ⋅cos⁡2θ=sin⁡2θcos⁡2θ⋅cos⁡2θ=sin⁡2θ\begin{aligned} \sec^2\theta - 1 &= \tan^2\theta \\ \tan^2\theta \cdot \cos^2\theta &= \frac{\sin^2\theta}{\cos^2\theta} \cdot \cos^2\theta = \sin^2\theta \end{aligned}

Exercise 2: Prove

Prove that (sin⁡θ+cos⁡θ)2=1+sin⁡2θ(\sin\theta + \cos\theta)^2 = 1 + \sin 2\theta.

Answer

Expanding the left side gives 1+sin⁡2θ1 + \sin 2\theta.

Solution
(sin⁡θ+cos⁡θ)2=sin⁡2θ+2sin⁡θcos⁡θ+cos⁡2θ=(sin⁡2θ+cos⁡2θ)+2sin⁡θcos⁡θ=1+sin⁡2θ■\begin{aligned} (\sin\theta + \cos\theta)^2 &= \sin^2\theta + 2\sin\theta\cos\theta + \cos^2\theta \\ &= (\sin^2\theta + \cos^2\theta) + 2\sin\theta\cos\theta \\ &= 1 + \sin 2\theta \qquad\blacksquare \end{aligned}

Exercise 3: Prove with a conjugate

Prove cos⁡θ/(1−sin⁡θ)=(1+sin⁡θ)/cos⁡θ\cos\theta/(1 - \sin\theta) = (1 + \sin\theta)/\cos\theta.

Answer

Multiply the left side by (1+sin⁡θ)/(1+sin⁡θ)(1 + \sin\theta)/(1 + \sin\theta).

Solution
cos⁡θ1−sin⁡θ⋅1+sin⁡θ1+sin⁡θ=cos⁡θ (1+sin⁡θ)1−sin⁡2θ=cos⁡θ (1+sin⁡θ)cos⁡2θ=1+sin⁡θcos⁡θ■\begin{aligned} &\frac{\cos\theta}{1 - \sin\theta} \cdot \frac{1 + \sin\theta}{1 + \sin\theta} \\ &\quad = \frac{\cos\theta\,(1 + \sin\theta)}{1 - \sin^2\theta} \\ &\quad = \frac{\cos\theta\,(1 + \sin\theta)}{\cos^2\theta} \\ &\quad = \frac{1 + \sin\theta}{\cos\theta} \qquad\blacksquare \end{aligned}
python · try it yourself
import sympy as sp
t = sp.Symbol("t")
print(sp.simplify(sp.cos(t) / (1 - sp.sin(t)) - (1 + sp.sin(t)) / sp.cos(t)))
0

Exercise 4: Product to sum

Write sin⁡5x⋅cos⁡3x\sin 5x \cdot \cos 3x as a sum of sines, and check it at x=0.4x = 0.4.

Answer

sin⁡5xcos⁡3x=12(sin⁡8x+sin⁡2x)\sin 5x\cos 3x = \tfrac{1}{2}(\sin 8x + \sin 2x). At x=0.4x = 0.4 both sides are about 0.3295.

Solution

Use sin⁡αcos⁡β=12[sin⁡(α+β)+sin⁡(α−β)]\sin\alpha\cos\beta = \tfrac{1}{2}[\sin(\alpha + \beta) + \sin(\alpha - \beta)] with α=5x\alpha = 5x, β=3x\beta = 3x.

python · try it yourself
import math
x = 0.4
print(round(math.sin(5*x) * math.cos(3*x), 6), round(0.5 * (math.sin(8*x) + math.sin(2*x)), 6))
0.329491 0.329491

Exercise 5: Find the false one

Use the holds approach (random tests) to decide which of these is not an identity: (a) cos⁡4x−sin⁡4x=cos⁡2x\cos^4 x - \sin^4 x = \cos 2x, (b) tan⁡x+1=sec⁡x\tan x + 1 = \sec x, (c) sin⁡3x=3sin⁡x−4sin⁡3x\sin 3x = 3\sin x - 4\sin^3 x.

Answer

(b) is false (the true identity is tan⁡2x+1=sec⁡2x\tan^2 x + 1 = \sec^2 x).

Solution
python · try it yourself
import math, random
rng = random.Random(1)

def holds(f, g):
    for _ in range(500):
        x = rng.uniform(-5, 5)
        if not math.isclose(f(x), g(x), abs_tol=1e-9):
            return False
    return True

print("a", holds(lambda x: math.cos(x)**4 - math.sin(x)**4, lambda x: math.cos(2*x)))
print("b", holds(lambda x: math.tan(x) + 1, lambda x: 1 / math.cos(x)))
print("c", holds(lambda x: math.sin(3*x), lambda x: 3*math.sin(x) - 4*math.sin(x)**3))
a True
b False
c True

Test yourself

Which identity follows from dividing sin⁡2θ+cos⁡2θ=1\sin^2\theta + \cos^2\theta = 1 by cos⁡2θ\cos^2\theta?

  1. 1+cot⁡2θ=csc⁡2θ1 + \cot^2\theta = \csc^2\theta
  2. tan⁡2θ+1=sec⁡2θ\tan^2\theta + 1 = \sec^2\theta
  3. sin⁡2θ=1−cos⁡2θ\sin^2\theta = 1 - \cos^2\theta
  4. tan⁡θ=sin⁡θ/cos⁡θ\tan\theta = \sin\theta / \cos\theta

Your random test finds an x where the two sides differ by 0.3. What can you conclude?

  1. Nothing, numeric tests are unreliable
  2. The equation is not an identity
  3. The equation is an identity with a rounding error
  4. SymPy must be used instead

Why is 2sin⁡2(θ/2)2\sin^2(\theta/2) better than 1−cos⁡θ1 - \cos\theta in code for tiny θ\theta?

  1. It is faster
  2. It avoids subtracting two nearly equal numbers, so it keeps precision
  3. It works in degrees
  4. It is not better; they are the same in floating point