△ Trigonometry & Trig Calculus
§01 Angles & Measurement
1.1 — Degrees, Radians & Gradians
An angle measures rotation between two rays sharing a common vertex. The radian is the natural unit: the angle subtended by an arc equal in length to the radius.
1.2 — Conversion Formulas
| From | To Radians | To Degrees |
|---|---|---|
| Degrees d | d · π/180 | — |
| Radians r | — | r · 180/π |
| Turns t | t · 2π | t · 360 |
1.3 — Special Angles
| Degrees | Radians | sin | cos | tan |
|---|---|---|---|---|
| 0° | 0 | 0 | 1 | 0 |
| 30° | π/6 | 1/2 | √3/2 | 1/√3 |
| 45° | π/4 | √2/2 | √2/2 | 1 |
| 60° | π/3 | √3/2 | 1/2 | √3 |
| 90° | π/2 | 1 | 0 | undefined |
| 180° | π | 0 | −1 | 0 |
| 270° | 3π/2 | −1 | 0 | undefined |
1.4 — Arc Length & Sector Area
§02 The Unit Circle
2.1 — Definition
The unit circle is the circle x² + y² = 1 centered at the origin. Every point on it can be written as (cos θ, sin θ) where θ is the angle measured counterclockwise from the positive x-axis.
2.2 — Interactive Unit Circle
2.3 — Quadrant Signs (ASTC Rule)
| Quadrant | Angle Range | sin | cos | tan | Mnemonic |
|---|---|---|---|---|---|
| I | 0° – 90° | + | + | + | All positive |
| II | 90° – 180° | + | − | − | Sin positive |
| III | 180° – 270° | − | − | + | Tan positive |
| IV | 270° – 360° | − | + | − | Cos positive |
2.4 — Reference Angles
The reference angle θ′ is the acute angle between the terminal side and the x-axis. For any θ: trig(θ) = ±trig(θ′), with the sign determined by the quadrant (ASTC rule).
§03 The Six Trigonometric Functions
3.1 — Definitions on the Unit Circle
3.2 — Domains & Ranges
| Function | Domain | Range | Period |
|---|---|---|---|
| sin θ | All ℝ | [−1, 1] | 2π |
| cos θ | All ℝ | [−1, 1] | 2π |
| tan θ | θ ≠ π/2 + nπ | (−∞, ∞) | π |
| csc θ | θ ≠ nπ | (−∞,−1]∪[1,∞) | 2π |
| sec θ | θ ≠ π/2 + nπ | (−∞,−1]∪[1,∞) | 2π |
| cot θ | θ ≠ nπ | (−∞, ∞) | π |
3.3 — Even/Odd Properties
§04 Right Triangles & SOH-CAH-TOA
4.1 — Definitions via Right Triangle
In a right triangle with acute angle θ, hypotenuse h, opposite side o, adjacent side a:
Mnemonic: SOH-CAH-TOA — Sin = Opposite/Hypotenuse, Cos = Adjacent/Hypotenuse, Tan = Opposite/Adjacent.
4.2 — The Pythagorean Theorem
4.3 — Special Right Triangles
| Triangle | Angles | Side Ratios |
|---|---|---|
| 45-45-90 | π/4, π/4, π/2 | 1 : 1 : √2 |
| 30-60-90 | π/6, π/3, π/2 | 1 : √3 : 2 |
4.4 — Interactive Triangle Solver
§05 Oblique Triangles
5.1 — Law of Sines
5.2 — Law of Cosines
5.3 — Law of Tangents
5.4 — Heron's Formula
5.5 — Area Formulas Summary
| Method | Formula |
|---|---|
| Base × Height | A = ½bh |
| Two sides + included angle | A = ½ab sin C |
| Heron's (three sides) | A = √[s(s−a)(s−b)(s−c)] |
| Circumradius | A = abc / (4R) |
| Inradius | A = rs (r = inradius) |
§06 Circles — Geometry & Trigonometry
6.1 — Circle Equations
6.2 — Arc Length & Sector Area
6.3 — Inscribed Angle Theorem
6.4 — Thales' Theorem
An angle inscribed in a semicircle is always 90°. This is the inscribed angle theorem with central angle 180° (π), giving inscribed angle = π/2.
6.5 — Chord Length & Tangent Lines
6.6 — Circles & Trigonometry in Navigation
The Haversine formula computes great-circle distances on a sphere using trig:
where φ = latitude, λ = longitude, R = Earth's radius. Every GPS device uses this formula.
§07 Trigonometric Identities
7.1 — Pythagorean Identities
7.2 — Sum & Difference Formulas
7.3 — Double-Angle Formulas
7.4 — Half-Angle Formulas
7.5 — Product-to-Sum & Sum-to-Product
7.6 — Power-Reduction Formulas
7.7 — Auxiliary Angle Method
§08 Inverse Trigonometric Functions
8.1 — Definitions & Ranges
| Function | Domain | Range (Principal Value) |
|---|---|---|
| arcsin x = sin⁻¹ x | [−1, 1] | [−π/2, π/2] |
| arccos x = cos⁻¹ x | [−1, 1] | [0, π] |
| arctan x = tan⁻¹ x | (−∞, ∞) | (−π/2, π/2) |
| arccsc x | |x| ≥ 1 | [−π/2, 0) ∪ (0, π/2] |
| arcsec x | |x| ≥ 1 | [0, π/2) ∪ (π/2, π] |
| arccot x | (−∞, ∞) | (0, π) |
8.2 — Key Identities
8.3 — atan2: The Full-Circle Arctangent
Unlike arctan(y/x), atan2 uses both coordinates to determine the correct quadrant. Essential in computer graphics, robotics, and signal processing.
8.4 — Compositions
§09 Graphs, Transformations & Waves
9.1 — General Sinusoid
| Parameter | Effect | Formula |
|---|---|---|
| A | Amplitude | |A| |
| B | Frequency | Period = 2π/|B| |
| C | Phase shift | Shift = −C/B |
| D | Vertical shift | Midline y = D |
9.2 — Interactive Wave Explorer
9.3 — Graphs of All Six Functions
| Function | Shape | Period | Asymptotes |
|---|---|---|---|
| sin x | Smooth wave, through origin | 2π | None |
| cos x | Smooth wave, max at x=0 | 2π | None |
| tan x | Increasing through origin, S-curves | π | x = π/2 + nπ |
| csc x | U/∩ curves between asymptotes | 2π | x = nπ |
| sec x | U/∩ curves between asymptotes | 2π | x = π/2 + nπ |
| cot x | Decreasing S-curves | π | x = nπ |
9.4 — Beats & Interference
When ω₁ ≈ ω₂, the cosine factor creates a slow envelope — the phenomenon of beats in acoustics. The sum-to-product identity is the mathematical engine.
§10 Derivatives of Trigonometric Functions
10.1 — The Foundational Limits
10.2 — d/dx [sin x] = cos x
10.3 — d/dx [cos x] = −sin x
10.4 — d/dx [tan x] = sec² x
10.5 — Complete Derivative Table
| f(x) | f′(x) | f(x) | f′(x) |
|---|---|---|---|
| sin x | cos x | arcsin x | 1/√(1−x²) |
| cos x | −sin x | arccos x | −1/√(1−x²) |
| tan x | sec²x | arctan x | 1/(1+x²) |
| csc x | −csc x cot x | arccsc x | −1/(|x|√(x²−1)) |
| sec x | sec x tan x | arcsec x | 1/(|x|√(x²−1)) |
| cot x | −csc²x | arccot x | −1/(1+x²) |
10.6 — Inverse Trig Derivative Proofs
10.7 — The nth Derivative Cycle
The derivatives cycle with period 4: sin → cos → −sin → −cos → sin → ⋯
§11 Integration of Trigonometric Functions
11.1 — Basic Antiderivatives
| ∫ f(x) dx | Result + C |
|---|---|
| ∫ sin x dx | −cos x |
| ∫ cos x dx | sin x |
| ∫ tan x dx | −ln|cos x| = ln|sec x| |
| ∫ cot x dx | ln|sin x| |
| ∫ sec x dx | ln|sec x + tan x| |
| ∫ csc x dx | −ln|csc x + cot x| = ln|csc x − cot x| |
| ∫ sec²x dx | tan x |
| ∫ csc²x dx | −cot x |
| ∫ sec x tan x dx | sec x |
| ∫ csc x cot x dx | −csc x |
11.2 — Proofs of Non-Obvious Integrals
11.3 — Powers of Trig Functions
∫ sinⁿx dx and ∫ cosⁿx dx
Odd power: Strip one factor, convert the rest using sin²x = 1 − cos²x, substitute u = cos x (or vice versa).
Even power: Use power-reduction: sin²x = (1 − cos 2x)/2, cos²x = (1 + cos 2x)/2.
11.4 — Trigonometric Substitution
| Expression | Substitution | Identity Used |
|---|---|---|
| √(a² − x²) | x = a sin θ | 1 − sin²θ = cos²θ |
| √(a² + x²) | x = a tan θ | 1 + tan²θ = sec²θ |
| √(x² − a²) | x = a sec θ | sec²θ − 1 = tan²θ |
11.5 — The Weierstrass Substitution
This converts any rational function of sin and cos into a rational function of t, solvable by partial fractions.
11.6 — The Gaussian Integral via Trig
§12 Polar Coordinates & Complex Numbers
12.1 — Polar Coordinates
12.2 — Common Polar Curves
| Curve | Equation | Shape |
|---|---|---|
| Circle | r = a | Circle radius a |
| Cardioid | r = a(1 + cos θ) | Heart shape |
| Rose | r = a cos(nθ) | n petals (n odd) or 2n petals (n even) |
| Lemniscate | r² = a² cos 2θ | Figure-8 |
| Spiral | r = aθ | Archimedean spiral |
12.3 — Area in Polar Coordinates
12.4 — Complex Numbers & Euler's Formula
12.5 — De Moivre's Theorem
12.6 — Roots of Unity
The n-th roots of unity form a regular n-gon on the unit circle. They are the foundation of the DFT (§13) and NTT (§14, lattice cryptography).
12.7 — Euler's Identity
Five fundamental constants — e, i, π, 1, 0 — united by trigonometry and the exponential function.
§13 Fourier Series & Applications
13.1 — Fourier Series
Any periodic function f(x) with period 2π can be expressed as:
13.2 — Discrete Fourier Transform (DFT)
13.3 — The FFT Algorithm
The Fast Fourier Transform computes the DFT in O(N log N) instead of O(N²) by exploiting the symmetry of roots of unity (the Cooley-Tukey butterfly). This makes audio processing, image compression (JPEG uses DCT, a real cousin of DFT), and polynomial multiplication practical.
13.4 — Parseval's Theorem
Energy in the time domain equals energy in the frequency domain — a conservation law derived from trig orthogonality.
13.5 — Application: The Basel Problem
§14 Cryptography — Trigonometry in Security
14.1 — Why Trig in Crypto?
Trigonometry appears throughout cryptography: from the periodicity that makes modular arithmetic work, to the Fourier transforms at the heart of lattice-based post-quantum schemes, to the geometry of elliptic curves.
14.2 — The Number Theoretic Transform (NTT)
The NTT is a DFT over a finite field 𝔽q instead of ℂ. It replaces e−2πi/N with a primitive N-th root of unity ω in 𝔽q (where ωN ≡ 1 mod q). The NTT enables fast polynomial multiplication in lattice cryptography (CRYSTALS-Kyber, Dilithium) without floating-point errors.
14.3 — Gaussian Sampling for Lattice Crypto
Lattice schemes sample noise from a discrete Gaussian ρσ(x) = exp(−π‖x‖²/σ²). The normalization uses the Gaussian integral (§11.6). The smoothing parameter ηε is computed via the Poisson summation formula, which is the Fourier transform (a trig integral) applied to lattices.
14.4 — Elliptic Curve Trigonometric Parameterization
Elliptic curves over ℂ can be parameterized by the Weierstrass ℘-function, which is doubly-periodic (two independent "periods" in the complex plane, generalizing the single period 2π of sin/cos). The group law on E corresponds to the addition theorem for ℘ — a direct generalization of trig addition formulas.
14.5 — CORDIC Algorithm
The CORDIC (COordinate Rotation DIgital Computer) algorithm computes sin, cos, arctan using only shifts and adds — no multiplication. It rotates a vector by successively smaller angles αᵢ = arctan(2⁻ⁱ):
where σᵢ = ±1 chooses the rotation direction. After n iterations, (xn, yn) ≈ K(cos θ, sin θ). CORDIC is used in hardware crypto accelerators where multipliers are expensive.
14.6 — Diffie-Hellman via Trig Analogy
The Diffie-Hellman key exchange: Alice picks secret a, publishes ga mod p. Bob picks secret b, publishes gb mod p. Shared secret: gab mod p.
Trig analogy: ga is like rotating by angle a on a "discrete unit circle" (the cyclic group ℤp*). Knowing the rotation angle from the final position is the discrete logarithm problem — as hard as un-rotating a circle when you can only see the endpoint.
14.7 — RSA & Euler's Totient
% --- NTT roots of unity in F_q --- q = 7681; N = 256; % q ≡ 1 mod 256 g = 17; % generator of F_q* omega = mod(power_mod(g, (q-1)/N, q), q); function r = power_mod(b,e,m) r=1;b=mod(b,m);while e>0;if mod(e,2)==1,r=mod(r*b,m);end;e=floor(e/2);b=mod(b*b,m);end end printf("NTT: ω=%d, ω^N mod q = %d (should be 1)\n", omega, power_mod(omega, N, q)); % --- CORDIC sine/cosine --- angles = atan(2.^-(0:29)); K = prod(1./sqrt(1 + 2.^(-2*(0:29)))); target = pi/5; x = K; y = 0; z = target; for i = 0:29 s = sign(z) + (z==0); xn = x - s*y*2^(-i); yn = y + s*x*2^(-i); z = z - s*angles(i+1); x = xn; y = yn; end printf("CORDIC: cos(π/5)=%.10f (exact %.10f)\n", x, cos(target)); printf("CORDIC: sin(π/5)=%.10f (exact %.10f)\n", y, sin(target));
§15 GNU Octave — Trigonometry & Trig Calculus Laboratory
15.1 — Verifying Trig Identities
% Verify fundamental identities at 1000 random angles th = 2*pi*rand(1,1000); e1 = max(abs(sin(th).^2 + cos(th).^2 - 1)); e2 = max(abs(sin(2*th) - 2*sin(th).*cos(th))); e3 = max(abs(cos(2*th) - (cos(th).^2 - sin(th).^2))); a = rand(1,1000)*pi; b = rand(1,1000)*pi; e4 = max(abs(sin(a+b) - (sin(a).*cos(b) + cos(a).*sin(b)))); printf("Identity errors (should be ≈0):\n"); printf(" sin²+cos²=1: %.2e\n sin 2θ: %.2e\n", e1, e2); printf(" cos 2θ: %.2e\n sin(a+b): %.2e\n", e3, e4);
15.2 — Numerical Derivatives of Trig Functions
% Verify all 6 trig derivatives with complex-step method h = 1e-20; x = 0.7; deriv = @(f,x) imag(f(x + 1i*h)) / h; funcs = {@sin, @cos, @tan, @csc, @sec, @cot}; exact_d = {cos(x), -sin(x), sec(x)^2, -csc(x)*cot(x), sec(x)*tan(x), -csc(x)^2}; names = {'sin','cos','tan','csc','sec','cot'}; printf("Trig derivatives at x = %.1f:\n", x); for k = 1:6 d = deriv(funcs{k}, x); printf(" d/dx[%s] = %12.8f (exact %12.8f, err %.1e)\n", ... names{k}, d, exact_d{k}, abs(d - exact_d{k})); end
15.3 — Numerical Integration of Trig Functions
% Verify antiderivatives numerically printf("Trig integrals:\n"); I1 = quad(@sin, 0, pi); printf(" ∫₀^π sin x dx = %.10f (exact 2)\n", I1); I2 = quad(@(x) sec(x).^2, 0, pi/4); printf(" ∫₀^(π/4) sec²x dx = %.10f (exact tan(π/4)=1)\n", I2); I3 = quad(@(x) 1./(1+x.^2), 0, 1); printf(" ∫₀¹ 1/(1+x²) dx = %.10f (exact π/4=%.10f)\n", I3, pi/4); I4 = quad(@(x) 1./sqrt(1-x.^2), 0, 0.5); printf(" ∫₀^0.5 1/√(1-x²) dx = %.10f (exact arcsin(0.5)=%.10f)\n", I4, asin(0.5)); % Reduction formula: ∫₀^(π/2) sin⁶x dx = 5π/32 I5 = quad(@(x) sin(x).^6, 0, pi/2); printf(" ∫₀^(π/2) sin⁶x dx = %.10f (exact 5π/32=%.10f)\n", I5, 5*pi/32);
15.4 — Fourier Synthesis & Analysis
% Square wave: f(x) = (4/π) Σ sin((2k-1)x)/(2k-1) x = linspace(-pi, pi, 1000); for N = [1, 5, 20, 100] f = zeros(size(x)); for k = 1:N n = 2*k - 1; f = f + sin(n*x)/n; end f = f * 4/pi; err = mean(abs(f - sign(sin(x)))); printf("Fourier N=%3d terms: mean error = %.6f\n", N, err); end
15.5 — Haversine Navigation
% Haversine formula: distance between two points on Earth function d = haversine(lat1, lon1, lat2, lon2) R = 6371; % Earth radius km p = pi/180; dlat = (lat2-lat1)*p; dlon = (lon2-lon1)*p; a = sin(dlat/2)^2 + cos(lat1*p)*cos(lat2*p)*sin(dlon/2)^2; d = 2*R*atan2(sqrt(a), sqrt(1-a)); end % New York → London d = haversine(40.7128, -74.0060, 51.5074, -0.1278); printf("NYC → London: %.1f km\n", d); % Tokyo → Sydney d = haversine(35.6762, 139.6503, -33.8688, 151.2093); printf("Tokyo → Sydney: %.1f km\n", d);
15.6 — Lissajous Figures & 3D Trig Surfaces
% Lissajous: x = sin(at+δ), y = sin(bt) t = linspace(0, 2*pi, 10000); for params = [3,2,pi/4; 5,4,pi/3; 7,6,pi/6]' a = params(1); b = params(2); delta = params(3); x = sin(a*t + delta); y = sin(b*t); printf("Lissajous a=%d b=%d: bounding box [%.2f,%.2f]×[%.2f,%.2f]\n", ... a, b, min(x), max(x), min(y), max(y)); end % 3D Torus: (R+r cos v)cos u, (R+r cos v)sin u, r sin v R = 3; r = 1; [u,v] = meshgrid(linspace(0,2*pi,50)); X = (R+r*cos(v)).*cos(u); Y = (R+r*cos(v)).*sin(u); Z = r*sin(v); printf("Torus: R=%d, r=%d, surface area = %.4f (exact 4π²Rr = %.4f)\n", ... R, r, 4*pi^2*R*r, 4*pi^2*R*r);
15.7 — Comprehensive Verification
printf("=== TRIG & CALCULUS VERIFICATION ===\n\n"); % Euler's identity printf("|e^(iπ)+1| = %.2e\n", abs(exp(1i*pi)+1)); % De Moivre n=7 th = 0.3; n = 7; lhs = (cos(th)+1i*sin(th))^n; rhs = cos(n*th)+1i*sin(n*th); printf("De Moivre (n=%d): error = %.2e\n", n, abs(lhs-rhs)); % Machin's formula: π = 4(4·atan(1/5) - atan(1/239)) pi_machin = 4*(4*atan(1/5) - atan(1/239)); printf("Machin π = %.15f (error %.2e)\n", pi_machin, abs(pi_machin-pi)); % Wallis product: π/2 = Π(4n²/(4n²-1)) n = 1:100000; wallis = prod(4*n.^2 ./ (4*n.^2 - 1)); printf("Wallis π/2 = %.10f (exact %.10f)\n", wallis, pi/2); % Leibniz: π/4 = 1 - 1/3 + 1/5 - ... n = 0:1e6; leibniz = sum((-1).^n ./ (2*n+1)); printf("Leibniz π/4 = %.10f (exact %.10f)\n", leibniz, pi/4); % Basel: Σ1/n² = π²/6 n = 1:1e6; basel = sum(1./n.^2); printf("Basel π²/6 = %.10f (exact %.10f)\n", basel, pi^2/6); % Gaussian integral I = quad(@(x) exp(-x.^2), -20, 20); printf("∫exp(-x²) = %.10f (exact √π = %.10f)\n", I, sqrt(pi));
⚡ Quick Reference Card
Trig Values
| θ | 0 | π/6 | π/4 | π/3 | π/2 |
|---|---|---|---|---|---|
| sin | 0 | ½ | √2/2 | √3/2 | 1 |
| cos | 1 | √3/2 | √2/2 | ½ | 0 |
| tan | 0 | 1/√3 | 1 | √3 | ∞ |
Derivatives & Integrals
| f | f′ | ∫f dx |
|---|---|---|
| sin x | cos x | −cos x |
| cos x | −sin x | sin x |
| tan x | sec²x | ln|sec x| |
| sec x | sec x tan x | ln|sec x+tan x| |
| csc x | −csc x cot x | ln|csc x−cot x| |
| cot x | −csc²x | ln|sin x| |
Inverse Trig Derivatives
| f | f′ |
|---|---|
| arcsin x | 1/√(1−x²) |
| arccos x | −1/√(1−x²) |
| arctan x | 1/(1+x²) |
Key Identities
| Identity |
|---|
| sin²θ + cos²θ = 1 |
| sin(α±β) = sin α cos β ± cos α sin β |
| cos(α±β) = cos α cos β ∓ sin α sin β |
| sin 2θ = 2 sin θ cos θ |
| cos 2θ = cos²θ − sin²θ |
| eiθ = cos θ + i sin θ |
Triangle Laws
| Law | Formula |
|---|---|
| Sines | a/sin A = b/sin B = c/sin C |
| Cosines | c² = a² + b² − 2ab cos C |
| Heron | A = √[s(s−a)(s−b)(s−c)] |
Trig Substitution
| √(a²−x²) | √(a²+x²) | √(x²−a²) |
|---|---|---|
| x = a sin θ | x = a tan θ | x = a sec θ |