Trigonometry Review
This reference lesson gathers the trigonometry that calculus uses: radian measure, the unit-circle definitions, exact values, the identities you need for integration, and inverse functions. In calculus angles are always in radians, because only then is the derivative of exactly .
Radians
An angle of radians cuts an arc of length from a circle of radius . A full turn is , so
Why radians? The limit as holds only in radians (it is proved in Proofs of Theorems). In degrees the derivative of would carry a factor forever.
Definitions on the unit circle
For the point reached by turning counter-clockwise from on the circle :
This works for every angle, not only acute ones, and immediately gives the signs per quadrant ( is positive in quadrants I and II, in I and IV, in I and III) and the periodicity: and have period , has period .
| undefined |
Identities you will use
| Group | Identities |
|---|---|
| Pythagorean | , , |
| Symmetry | , , |
| Addition | , |
| Double angle | , |
| Half angle (power reduction) | , |
| Product to sum | |
| Law of cosines |
The power-reduction formulas are the key to Trigonometric Integrals, and the Pythagorean ones drive Trigonometric Substitution. SymPy can confirm any identity: simplify the difference and expect 0.
import sympy as sp
a, b, t = sp.symbols('a b theta')
checks = {
"sin(a+b)": sp.sin(a + b) - (sp.sin(a)*sp.cos(b) + sp.cos(a)*sp.sin(b)),
"cos 2t": sp.cos(2*t) - (1 - 2*sp.sin(t)**2),
"1+tan^2": 1 + sp.tan(t)**2 - sp.sec(t)**2,
"sin^2 half-angle": sp.sin(t)**2 - (1 - sp.cos(2*t)) / 2,
}
for name, diff in checks.items():
print(f"{name:18} difference simplifies to {sp.simplify(sp.expand_trig(diff))}")
print("exact sin(pi/12) =", sp.expand_trig(sp.sin(a - b)).subs({a: sp.pi/4, b: sp.pi/6}))sin(a+b) difference simplifies to 0
cos 2t difference simplifies to 0
1+tan^2 difference simplifies to 0
sin^2 half-angle difference simplifies to 0
exact sin(pi/12) = -sqrt(2)/4 + sqrt(6)/4
The last line is from the subtraction formula.
Inverse trigonometric functions
To invert, each function is restricted to an interval where it is one-to-one:
| Function | Domain | Range |
|---|---|---|
So is not 3 but : the answer must lie in . Their derivatives appear in Inverse Functions and Logarithms; the gentle version is Trigonometric Functions.
In software: atan2
Turning a direction vector into an angle with atan(y / x) fails twice: it divides by zero for vertical vectors, and it cannot tell from since both give . math.atan2(y, x) looks at both signs and returns the correct angle in . Games use it to aim turrets and rotate sprites toward the mouse; graphics uses it for polar coordinates and hue in colour wheels.
import math
for x, y in [(1, 1), (-1, -1), (0, 2), (-3, 0), (1, -1)]:
naive = math.degrees(math.atan(y / x)) if x != 0 else float('nan')
good = math.degrees(math.atan2(y, x))
print(f"({x:2}, {y:2}) atan(y/x) = {naive:7.1f} atan2 = {good:7.1f}")
print("arcsin(sin 3) =", round(math.asin(math.sin(3)), 4), " pi - 3 =", round(math.pi - 3, 4))( 1, 1) atan(y/x) = 45.0 atan2 = 45.0
(-1, -1) atan(y/x) = 45.0 atan2 = -135.0
( 0, 2) atan(y/x) = nan atan2 = 90.0
(-3, 0) atan(y/x) = -0.0 atan2 = 180.0
( 1, -1) atan(y/x) = -45.0 atan2 = -45.0
arcsin(sin 3) = 0.1416 pi - 3 = 0.1416
Other places: rotation matrices , oscillations in audio and animation, and the sinusoidal positional encodings of transformer models.
Exercises
Exercise 1: Exact values
Find exact values of and .
Answer
, .
Solution
is in quadrant II with reference angle , and cosine is negative there: . is in quadrant IV with reference angle ; , , so .
Exercise 2: Prove an identity
Show that .
Answer
Both sides equal (wherever ).
Solution
Exercise 3: Sector
A sector of a circle of radius 6 has arc length 9. Find its angle in radians and degrees, and its area.
Answer
, area 27.
Solution
. In degrees . .
Exercise 4: Solve an equation (code)
Find all solutions of in . Solve by hand (it is a quadratic in ), then check with SymPy.
Answer
.
Solution
import sympy as sp
x, s = sp.symbols('x s')
roots = sp.solve(2*s**2 - s - 1, s) # quadratic in s = sin x
print("sin x =", roots)
for r in roots:
print(r, "->", sp.solveset(sp.sin(x) - r, x, sp.Interval.Ropen(0, 2*sp.pi)))sin x = [-1/2, 1]
-1/2 -> {7*pi/6, 11*pi/6}
1 -> {pi/2}
Test yourself
How many radians is ?
Which identity turns into something easy?
Why is atan2(y, x) preferred over atan(y/x) for a direction vector?
- It is faster
- It returns degrees
- It uses both signs to find the quadrant and handles
- It works only for unit vectors