Derivatives of Trigonometric Functions
Push a child on a swing and their height rises and falls like a sine wave; ask how fast they
are moving at any instant and you are asking for its derivative. The speed of anything that
swings, vibrates or wobbles is exactly what the trig derivatives on this page deliver.
Trace the graph of \sin x with your finger. It climbs, eases off,
curls over at the top, tips back down, bottoms out, and climbs again — a smooth, endless swell.
Now ask the calculus question: how steep is it at each point? Plot that slope, moment by
moment, and something almost magical happens — the slope graph is another wave of the
exact same shape, just slid over a quarter turn. It's \cos x.
Differentiate \sin x and you get \cos x;
differentiate \cos x and you get -\sin x:
\frac{d}{dx}\sin x = \cos x, \qquad \frac{d}{dx}\cos x = -\sin x
Differentiating doesn't leave the trig family — it just shifts you around it.
That is not a coincidence; it is the deep reason sine waves describe things that
oscillate. A quantity whose rate of change keeps feeding back into itself like this can
never settle down — it has to keep swinging. That is the mathematics of a plucked string, a
swinging pendulum, a note of music, and the light reaching your eye right now.
The picture behind it: slope becomes height
The slope of \sin x at each point is exactly the
height of \cos x there. Check it at three places:
-
At x = 0, \sin x is rising as steeply as
it ever will (slope 1) — and sure enough
\cos 0 = 1.
-
At the crest, x = \tfrac{\pi}{2}, the sine wave is momentarily
flat (slope 0) — and
\cos\tfrac{\pi}{2} = 0.
-
Just past the crest the wave is falling, so its slope is negative — and
\cos x has indeed dipped below the axis there.
That is why differentiating slides the wave a quarter period to the left: the cosine curve is
just the sine curve reporting on its own steepness.
Tangent, too
The tangent function fits the same family, with a slightly busier derivative:
\frac{d}{dx}\tan x = \sec^2 x
You can see where this comes from: \tan x = \tfrac{\sin x}{\cos x}, and
applying the quotient
rule to that fraction tidies up (using
\sin^2 x + \cos^2 x = 1) into the neat
\dfrac{1}{\cos^2 x} = \sec^2 x. Because
\sec^2 x \ge 1 everywhere it is defined, the tangent curve is
always climbing — it never turns over.
For the three standard trig functions:
- \dfrac{d}{dx}\sin x = \cos x;
- \dfrac{d}{dx}\cos x = -\sin x;
- \dfrac{d}{dx}\tan x = \sec^2 x;
- these hold only when x is measured in radians;
- combine with the chain rule: \dfrac{d}{dx}\sin(kx) = k\cos(kx).
See the slope become the height
Here is y = \sin x (solid) drawn over a few periods, with its
derivative y' = \cos x (dashed). Pick any point on the solid wave:
how steeply it climbs there is exactly the height of the dashed wave at the same
x. Where \sin x is flattest at its peaks,
\cos x crosses zero; where \sin x rises
fastest through the origin, \cos x is at its highest.
Worked example 1 — the chain rule on \sin(3x)
A great deal of real trig calculus is \sin(kx), not bare
\sin x — the k sets how fast the wave
wobbles. Differentiate y = \sin(3x).
-
The outer function is \sin(\;\cdot\;), whose
derivative is \cos(\;\cdot\;). The inner function
is 3x, whose derivative is 3.
-
The chain rule says
"differentiate the outside, keep the inside, then multiply by the derivative of the inside":
\frac{d}{dx}\sin(3x) = \cos(3x)\cdot 3 = 3\cos(3x).
The 3 pops out the front. The same move gives
\dfrac{d}{dx}\cos(5x) = -5\sin(5x) — outer derivative
-\sin, times the inner derivative 5.
Worked example 2 — a product, x\cos x
Differentiate y = x\cos x. This is one thing times another, so reach
for the product rule,
(uv)' = u'v + uv', with u = x and
v = \cos x.
- u = x \;\Rightarrow\; u' = 1;
- v = \cos x \;\Rightarrow\; v' = -\sin x (mind the minus!).
\frac{d}{dx}\big(x\cos x\big) = (1)(\cos x) + (x)(-\sin x) = \cos x - x\sin x.
Notice how the -\sin x from differentiating cosine carries its minus
sign right through to the answer. Lose that sign and the whole thing is wrong.
Worked example 3 — finding a stationary point
Where does y = \sin x have a stationary point (a peak
or trough) between 0 and 2\pi? A stationary
point is where the slope is zero, so set the derivative to zero:
y' = \cos x = 0 \;\Rightarrow\; x = \frac{\pi}{2}\ \text{ or }\ x = \frac{3\pi}{2}.
At x = \tfrac{\pi}{2}, \sin x = 1 — the
maximum. At x = \tfrac{3\pi}{2},
\sin x = -1 — the minimum. The derivative found the
crest and the trough of the wave for us, exactly where the tangent line goes flat. This is the
everyday job of a trig derivative: locating the high and low points of anything that oscillates.
Every rule on this page — \tfrac{d}{dx}\sin x = \cos x and its
siblings — is only correct when x is in radians. In
degrees they are simply wrong. Differentiate \sin(x^\circ) and an ugly
conversion factor crawls out:
\frac{d}{dx}\sin(x^\circ) = \frac{\pi}{180}\cos(x^\circ).
That stray \tfrac{\pi}{180} \approx 0.01745 is the fingerprint of the
wrong unit. It appears because the clean limit
\displaystyle\lim_{h\to 0}\tfrac{\sin h}{h} = 1 — the fact the whole
derivative rests on — is only 1 when h is in
radians. This is the real reason mathematicians call radians the natural unit for
angles: they are the choice that makes calculus come out clean. So set your calculator to radians
before you differentiate.
And two more classic slips: don't lose the minus on
\tfrac{d}{dx}\cos x = -\sin x, and don't forget the chain
rule — \tfrac{d}{dx}\sin(kx) = k\cos(kx) has a factor of
k out front, not just \cos(kx).
Keep differentiating and watch the four-step loop:
\sin x \;\to\; \cos x \;\to\; -\sin x \;\to\; -\cos x \;\to\; \sin x \;\to\;\cdots
Four turns of the crank and you are back where you started. That closed loop is the mathematical
signature of oscillation. Look at the second derivative:
\frac{d^2}{dx^2}\sin x = -\sin x.
Read that as a sentence: "the acceleration of this quantity is the negative of the
quantity itself." Whenever something gets pulled back towards the middle in proportion to how far
it has strayed — a mass on a spring, a pendulum, the air pressure in a sound wave, the current in
an AC circuit, the field of a light wave, even a quantum wavefunction — it obeys exactly this
equation, and the answer must be a sine or cosine. A system whose rate of change feeds
back on itself this way has no choice but to oscillate. That single feedback loop, captured by
these little derivative rules, is the heart of every equation for waves and vibrations in physics.
See it explained