Mathematics/Lessons/Differentiation/Differentiating Sin and Cos Functions
Pure · Differentiation · Year 2

Differentiating Sin and Cos Functions

Two standard results that unlock every trig derivative to come — with tan x following as a bonus.

8 min read 3 worked examples

The two standard results

Differentiating from first principles — using the fact that, when $x$ is measured in radians, $\dfrac{\sin h}{h}\to1$ and $\dfrac{\cos h-1}{h}\to0$ as $h\to0$ — gives two clean results:

$\dfrac{d}{dx}(\sin x)=\cos x \qquad\qquad \dfrac{d}{dx}(\cos x)=-\sin x$

Notice the pattern: differentiating rotates sine into cosine, and cosine into negative sine. Differentiate twice and you return to the original function with a sign flip — $\dfrac{d^2}{dx^2}(\sin x)=-\sin x$.

Radians only

Both results depend on $x$ being in radians. If $x$ were in degrees, extra conversion factors of $\dfrac{\pi}{180}$ would creep into every derivative — one of the main reasons calculus always works in radians.

A bonus result: differentiating tan x

Since $\tan x=\dfrac{\sin x}{\cos x}$ is built from sine and cosine, its derivative follows from the two results above — the full derivation needs the quotient rule (met in a later lesson), but the result itself is worth having now:

$\dfrac{d}{dx}(\tan x)=\sec^2 x$

where $\sec x=\dfrac{1}{\cos x}$. All three results — for $\sin x$, $\cos x$, and $\tan x$ — are worth memorising immediately, since they appear constantly from here on.

Extending to sin(kx) and cos(kx)

For a constant $k$, the same two functions scaled inside give:

$\dfrac{d}{dx}(\sin kx)=k\cos kx \qquad\qquad \dfrac{d}{dx}(\cos kx)=-k\sin kx \qquad\qquad \dfrac{d}{dx}(\tan kx)=k\sec^2kx$
A preview of the chain rule

The extra factor of $k$ appears because the "inside" of the function isn't simply $x$ — it's $kx$, which has its own rate of change of $k$. This is a special case of a general technique for differentiating composite functions called the chain rule, covered in full a little later in this topic. For now, it's enough to recognise the pattern: differentiate as if the inside were $x$, then multiply by the derivative of the inside.

Worked example 1

Standard derivatives with the sum rule
Differentiate $y=4\sin x+5\cos x-3x^3$.
MethodDifferentiate term by term
1
$\dfrac{d}{dx}(4\sin x)=4\cos x$.
Standard result, scaled by the constant 4.
2
$\dfrac{d}{dx}(5\cos x)=-5\sin x$.
Standard result, scaled by 5.
3
$\dfrac{d}{dx}(-3x^3)=-9x^2$.
Ordinary power rule.
4
$\dfrac{dy}{dx}=4\cos x-5\sin x-9x^2$.
Add the three terms.
▪ solved

Worked example 2

Linear inner functions
Differentiate (a) $y=\sin 5x$, (b) $y=\cos 2x+\tan 3x$.
MethodApply the sin(kx)/cos(kx)/tan(kx) pattern
1
(a) Here $k=5$, so $\dfrac{dy}{dx}=5\cos 5x$.
$\dfrac{d}{dx}(\sin kx)=k\cos kx$.
2
(b) For $\cos 2x$: $k=2$, giving $-2\sin 2x$.
$\dfrac{d}{dx}(\cos kx)=-k\sin kx$.
3
For $\tan 3x$: $k=3$, giving $3\sec^2 3x$.
$\dfrac{d}{dx}(\tan kx)=k\sec^2 kx$.
4
$\dfrac{dy}{dx}=-2\sin 2x+3\sec^2 3x$.
Add the two derivatives from part (b).
▪ solved

Worked example 3

Finding stationary points · Challenge
Find the values of $x$ in the interval $0\le x\le2\pi$ for which $y=\sin x+\cos x$ has a stationary point.
MethodSet the derivative equal to zero and solve
1
$\dfrac{dy}{dx}=\cos x-\sin x$.
Differentiate term by term.
2
Stationary points occur where $\cos x-\sin x=0$, i.e. $\cos x=\sin x$.
A stationary point has zero gradient.
3
Dividing both sides by $\cos x$ (valid since $\cos x\ne0$ here): $1=\tan x$, so $\tan x=1$.
Rearrange into a standard trig equation.
4
In $0\le x\le2\pi$: $x=\dfrac{\pi}{4}$ or $x=\dfrac{\pi}{4}+\pi=\dfrac{5\pi}{4}$.
$\tan x=1$ has period $\pi$, giving two solutions in a full $2\pi$ interval.
▪ solved
Look deeper

Writing $y=\sin x+\cos x$ in the form $R\sin(x+\alpha)$ (met in the Trigonometric Modelling topic) shows immediately why these two stationary points exist one period apart — they're the maximum and minimum of the single wave $R\sin(x+\alpha)$.

Common mistake

Forgetting the negative sign when differentiating $\cos x$ (writing $\dfrac{d}{dx}(\cos x)=\sin x$ instead of $-\sin x$), and forgetting the factor of $k$ when differentiating $\sin kx$, $\cos kx$, or $\tan kx$.

Check yourself

Differentiate $y=2\cos x-3\sin 4x+\tan x$.

Method
1
$\dfrac{d}{dx}(2\cos x)=-2\sin x$.
Standard result, scaled by 2.
2
$\dfrac{d}{dx}(-3\sin 4x)=-3(4\cos 4x)=-12\cos 4x$.
$k=4$ for the $\sin(kx)$ pattern.
3
$\dfrac{d}{dx}(\tan x)=\sec^2 x$.
Standard result.
4
$\dfrac{dy}{dx}=-2\sin x-12\cos 4x+\sec^2 x$.
Add the three terms.
▪ solved