Cheatsheet: Trig derivatives from geometry
The results
Section titled “The results”d/dx( sin(x) ) = cos(x)d/dx( cos(x) ) = -sin(x)Minus sign on cosine. Derived, not memorized.
The derivation (one picture)
Section titled “The derivation (one picture)”- A point at angle
xon the unit circle sits at(cos x, sin x). Sine and cosine are its coordinates. - Radians make arc length equal angle, so nudging
xbydxmoves the point arc lengthdx: unit speed. - Moving on a circle, velocity is perpendicular to position (tangent), length 1, pointing 90° counterclockwise.
- Rotating
(a, b)by 90° CCW gives(-b, a). So velocity= (-sin x, cos x). - Velocity components are the coordinates’ rates of change:
- horizontal coord
cos xchanges at-sin x->d/dx(cos x) = -sin x - vertical coord
sin xchanges atcos x->d/dx(sin x) = cos x
- horizontal coord
Sanity checks
Section titled “Sanity checks”x | sin / its slope cos | cos / its slope -sin |
|---|---|---|
0 | sin 0 = 0, slope cos 0 = 1 (climbing) | cos 0 = 1 peak, slope 0 (flat) |
π/2 | sin = 1 peak, slope cos = 0 (flat) | cos = 0, slope -sin = -1 (descending) |
All match the curve shapes.
Two payoffs
Section titled “Two payoffs”- Small-angle: near 0,
sin(x) ≈ x(slope at 0 iscos 0 = 1). First sliver of Taylor series. - Oscillation:
d²/dx²(sin x) = -sin x, sof'' = -f. This is the equation of springs, pendulums, sound, AC current, light. Why sine is everywhere in physics.
Why radians
Section titled “Why radians”The derivation needs unit speed, which needs arc length = angle, which is the definition of a radian. In degrees the point moves at speed π/180, and every trig derivative would carry an ugly π/180. Radians make calculus on trig clean.
Why it matters for AI
Section titled “Why it matters for AI”- Transformer positional encodings (Vaswani et al., 2017) use sin/cos waves of different frequencies to encode token position; differentiating through them uses these derivatives.
- 3D rotations (differentiable rendering, pose estimation) use sin/cos in rotation matrices.
- Signal processing / Fourier decomposes signals into sin/cos components.
Pitfalls to dodge
Section titled “Pitfalls to dodge”- Memorizing the pair (which gets the minus?). The picture decides: cosine’s coordinate shrinks as the point climbs, so the minus is on cosine.
- Forgetting radians. Clean derivatives hold only in radians.
- Treating trig as a separate topic. Same nudge-and-look method as the power rule, different shape.
- Confusing velocity with position. Position
(cos x, sin x); velocity (the derivative)(-sin x, cos x).
The one-line version
Section titled “The one-line version”Sine and cosine are a circling point’s coordinates, and their derivatives are its velocity, the position rotated a quarter turn, so sin -> cos and cos -> -sin.