24.4 Derivatives of Trigonometric Functions
SL 5.6 AHL 5.15
- the derivatives of \(\sin x\) and \(\cos x\) (SL), and why \(x\) must be in radians
- the derivatives of \(\tan x\), \(\sec x\), \(\operatorname{cosec} x\) and \(\cot x\) (HL)
- how to use the chain, product and quotient rules with trigonometric functions
- the derivatives of the inverse functions \(\arcsin x\), \(\arccos x\) and \(\arctan x\) (HL)
In calculus, angles are always measured in radians. The formulae on this page are not true in degrees. (For radians and the trigonometric graphs, see Unit 14.)
Derivatives of sin x and cos x
Derivatives of \(\sin x\) and \(\cos x\) (\(x\) in radians) In the formula booklet
\[ f(x) = \sin x \;\Rightarrow\; f'(x) = \cos x \qquad\qquad f(x) = \cos x \;\Rightarrow\; f'(x) = -\sin x \]
You can see the first result on the graphs: where \(y = \sin x\) has a maximum or minimum (gradient \(0\)), \(\cos x = 0\); at \(x = 0\) the sine curve is steepest, with gradient \(1 = \cos 0\).
Use the compound angle formula \(\sin(x + h) = \sin x \cos h + \cos x \sin h\):
\[ \frac{\sin(x + h) - \sin x}{h} = \sin x \cdot \frac{\cos h - 1}{h} + \cos x \cdot \frac{\sin h}{h} . \]
When \(h\) is in radians, \(\displaystyle\lim_{h \to 0}\frac{\sin h}{h} = 1\) and \(\displaystyle\lim_{h \to 0}\frac{\cos h - 1}{h} = 0\) (see Unit 26). So the limit is \(\sin x \cdot 0 + \cos x \cdot 1 = \cos x\). In degrees the first limit is \(\dfrac{\pi}{180}\), not \(1\) — this is why we use radians.
The other trigonometric functions
Once we know the derivatives of \(\sin x\) and \(\cos x\), the quotient rule and the chain rule give the rest.
Example 1 (a) Use the quotient rule to show that \(\dfrac{\mathrm{d}}{\mathrm{d}x}(\tan x) = \sec^2 x\).
(b) Use the chain rule to show that \(\dfrac{\mathrm{d}}{\mathrm{d}x}(\sec x) = \sec x \tan x\).
(a) \(\tan x = \dfrac{\sin x}{\cos x}\). With \(u = \sin x\) and \(v = \cos x\):
\[ \frac{\mathrm{d}}{\mathrm{d}x}(\tan x) = \frac{\cos x \cdot \cos x - \sin x \cdot (-\sin x)}{\cos^2 x} = \frac{\cos^2 x + \sin^2 x}{\cos^2 x} = \frac{1}{\cos^2 x} = \sec^2 x . \]
(b) \(\sec x = (\cos x)^{-1}\). By the chain rule,
\[ \frac{\mathrm{d}}{\mathrm{d}x}(\sec x) = -1(\cos x)^{-2} \times (-\sin x) = \frac{\sin x}{\cos^2 x} = \frac{1}{\cos x} \cdot \frac{\sin x}{\cos x} = \sec x \tan x . \]
In the same way you can show the results for \(\operatorname{cosec} x\) and \(\cot x\) (try it).
Derivatives of the six trigonometric functions (\(x\) in radians) In the formula booklet
| \(f(x)\) | \(f'(x)\) | \(f(x)\) | \(f'(x)\) | |
|---|---|---|---|---|
| \(\sin x\) | \(\cos x\) | \(\operatorname{cosec} x\) | \(-\operatorname{cosec} x \cot x\) | |
| \(\cos x\) | \(-\sin x\) | \(\sec x\) | \(\sec x \tan x\) | |
| \(\tan x\) | \(\sec^2 x\) | \(\cot x\) | \(-\operatorname{cosec}^2 x\) |
The derivatives of \(\tan x\), \(\sec x\), \(\operatorname{cosec} x\) and \(\cot x\) are AHL 5.15. (\(\operatorname{cosec} x\) is also written \(\csc x\).)
\(\tan x\), \(\sec x\), \(\operatorname{cosec} x\) and \(\cot x\) are only in the HL booklet.
A memory aid: the derivatives of the “co-” functions (\(\cos\), \(\operatorname{cosec}\), \(\cot\)) all start with a minus sign.
Using the chain rule
Example 2 Differentiate with respect to \(x\):
(a) \(\sin 4x\) \(\qquad\) (b) \(\cos\left(5x + \dfrac{\pi}{3}\right)\)
(a) The inside is \(4x\), with derivative \(4\): \(\;\dfrac{\mathrm{d}}{\mathrm{d}x}(\sin 4x) = 4\cos 4x\).
(b) The inside is \(5x + \dfrac{\pi}{3}\), with derivative \(5\): \(\;\dfrac{\mathrm{d}}{\mathrm{d}x}\cos\left(5x + \dfrac{\pi}{3}\right) = -5\sin\left(5x + \dfrac{\pi}{3}\right)\).
In general, if \(f(x)\) is any function, the chain rule gives the following.
Trigonometric functions of a function Not in the formula booklet
| \(y\) | \(\dfrac{\mathrm{d}y}{\mathrm{d}x}\) | \(y\) | \(\dfrac{\mathrm{d}y}{\mathrm{d}x}\) | |
|---|---|---|---|---|
| \(\sin f(x)\) | \(f'(x)\cos f(x)\) | \(\operatorname{cosec} f(x)\) | \(-f'(x)\operatorname{cosec} f(x)\cot f(x)\) | |
| \(\cos f(x)\) | \(-f'(x)\sin f(x)\) | \(\sec f(x)\) | \(f'(x)\sec f(x)\tan f(x)\) | |
| \(\tan f(x)\) | \(f'(x)\sec^2 f(x)\) | \(\cot f(x)\) | \(-f'(x)\operatorname{cosec}^2 f(x)\) |
In particular, \(\dfrac{\mathrm{d}}{\mathrm{d}x}\sin(ax + b) = a\cos(ax + b)\) and \(\dfrac{\mathrm{d}}{\mathrm{d}x}\cos(ax + b) = -a\sin(ax + b)\).
- \(f(x)\): the inside function
- \(f'(x)\): the derivative of the inside function
- \(a\), \(b\): constants
Remember that \(\sin^n x\) means \((\sin x)^n\). To differentiate it, use the power-of-a-function rule from 24.3.
Example 3 Differentiate with respect to \(x\):
(a) \(\cos\sqrt{2x + 9}\)
(b) \(\sin^3 2x \cos x\)
(c) AHL \(\cot(x^2 - 3x + 1)\)
(d) AHL \(\sqrt{\tan 2x}\)
(a) The inside is \((2x + 9)^{\frac{1}{2}}\), with derivative \(\dfrac{1}{2}(2x + 9)^{-\frac{1}{2}} \times 2 = \dfrac{1}{\sqrt{2x + 9}}\). So
\[ \frac{\mathrm{d}y}{\mathrm{d}x} = -\frac{\sin\sqrt{2x + 9}}{\sqrt{2x + 9}} . \]
(b) Product rule with \(u = \sin^3 2x\) and \(v = \cos x\). By the chain rule \(u' = 3\sin^2 2x \times 2\cos 2x = 6\sin^2 2x\cos 2x\).
\[ \begin{aligned} \frac{\mathrm{d}y}{\mathrm{d}x} &= 6\sin^2 2x\cos 2x\cos x - \sin^3 2x\sin x \\ &= \sin^2 2x\,(6\cos 2x\cos x - \sin 2x\sin x) . \end{aligned} \]
(c) \(\;-(2x - 3)\operatorname{cosec}^2(x^2 - 3x + 1)\).
(d) \(y = (\tan 2x)^{\frac{1}{2}}\). Two layers of the chain rule:
\[ \begin{aligned} \frac{\mathrm{d}y}{\mathrm{d}x} &= \frac{1}{2}(\tan 2x)^{-\frac{1}{2}} \times 2\sec^2 2x \\ &= \frac{\sec^2 2x}{\sqrt{\tan 2x}} . \end{aligned} \]
Example 4 Find the gradient of the curve \(y = x^2\cos x\) at the point where \(x = \pi\).
Product rule: \(\;\dfrac{\mathrm{d}y}{\mathrm{d}x} = 2x\cos x - x^2\sin x\).
At \(x = \pi\): \(\;2\pi\cos\pi - \pi^2\sin\pi = 2\pi(-1) - 0 = -2\pi\).
Derivatives of inverse trigonometric functions
AHL 5.15
Recall the inverse sine function (Figure 1):
\[ y = \arcsin x \quad\Longleftrightarrow\quad x = \sin y, \qquad -1 \le x \le 1, \quad -\frac{\pi}{2} \le y \le \frac{\pi}{2} . \]
Differentiate \(x = \sin y\) with respect to \(y\): \(\;\dfrac{\mathrm{d}x}{\mathrm{d}y} = \cos y\), so
\[ \frac{\mathrm{d}y}{\mathrm{d}x} = \frac{1}{\cos y} . \]
We need the answer in terms of \(x\). Since \(-\dfrac{\pi}{2} \le y \le \dfrac{\pi}{2}\), \(\cos y \ge 0\), so
\[ \cos y = \sqrt{1 - \sin^2 y} = \sqrt{1 - x^2} \qquad\Rightarrow\qquad \frac{\mathrm{d}}{\mathrm{d}x}(\arcsin x) = \frac{1}{\sqrt{1 - x^2}} . \]
Be careful with the notation: \(\sin^{-1}x\) means \(\arcsin x\). It is not \(\dfrac{1}{\sin x}\), and it is not the same as \((\sin x)^{-1}\).
Example 5 Let \(y = \arctan x\). By writing \(x = \tan y\), show that \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = \dfrac{1}{1 + x^2}\).
\(x = \tan y\), so \(\dfrac{\mathrm{d}x}{\mathrm{d}y} = \sec^2 y = 1 + \tan^2 y = 1 + x^2\).
Therefore \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = \dfrac{1}{\;\frac{\mathrm{d}x}{\mathrm{d}y}\;} = \dfrac{1}{1 + x^2}\).
Derivatives of the inverse trigonometric functions In the HL formula booklet
\[ \begin{aligned} f(x) = \arcsin x \;&\Rightarrow\; f'(x) = \frac{1}{\sqrt{1 - x^2}} \\ f(x) = \arccos x \;&\Rightarrow\; f'(x) = -\frac{1}{\sqrt{1 - x^2}} \\ f(x) = \arctan x \;&\Rightarrow\; f'(x) = \frac{1}{1 + x^2} \end{aligned} \]
The first two need \(|x| < 1\); the third is true for all real \(x\).
Example 6 Differentiate with respect to \(x\):
(a) \(\arcsin 3x\)
(b) \(\arccos(x^3)\), \(\;|x| < 1\)
(c) \(\arctan\sqrt{x}\), \(\;x > 0\)
Use the chain rule: replace \(x\) by the inside function, then multiply by its derivative.
(a) \(\;\dfrac{1}{\sqrt{1 - (3x)^2}} \times 3 = \dfrac{3}{\sqrt{1 - 9x^2}}\).
(b) \(\;-\dfrac{1}{\sqrt{1 - (x^3)^2}} \times 3x^2 = -\dfrac{3x^2}{\sqrt{1 - x^6}}\).
(c) \(\;\dfrac{1}{1 + (\sqrt{x})^2} \times \dfrac{1}{2\sqrt{x}} = \dfrac{1}{2\sqrt{x}\,(1 + x)}\).
Check that the calculator is in radian mode. The angle mode is shown at the top right of the screen (DEG or RAD). Click on it to switch between degrees and radians: it must show RAD.

You can also open Document Settings and change Angle to Radian.

Then use Menu → Calculus → Numerical Derivative at a Point. For example, for \(x^2\cos x\) at \(x = \pi\) the result is \(-6.28319\), which is \(-2\pi\). In degree mode you would get a wrong answer.
Common errors
| ✗ Wrong | ✓ Right | Why |
|---|---|---|
| \(\dfrac{\mathrm{d}}{\mathrm{d}x}(\cos x) = \sin x\) | \(-\sin x\) | The derivative of \(\cos\) has a minus sign. |
| \(\dfrac{\mathrm{d}}{\mathrm{d}x}(\sin 4x) = \cos 4x\) | \(4\cos 4x\) | Multiply by the derivative of the inside, \(4\). |
| \(\dfrac{\mathrm{d}}{\mathrm{d}x}(\sin 4x) = 4\cos x\) | \(4\cos 4x\) | The inside \(4x\) stays the same. |
| \(\dfrac{\mathrm{d}}{\mathrm{d}x}(\sin^2 x) = \cos^2 x\) | \(2\sin x\cos x\) | \(\sin^2 x = (\sin x)^2\): use the power rule and the chain rule. |
| \(\dfrac{\mathrm{d}}{\mathrm{d}x}(\arcsin x) = \dfrac{-\cos x}{\sin^2 x}\) | \(\dfrac{1}{\sqrt{1 - x^2}}\) | \(\arcsin x = \sin^{-1}x\) is the inverse function, not \(\dfrac{1}{\sin x}\). |
| Working in degrees | Radians | The formulae are only true in radians. |
Exercises
1 Differentiate \(y = 3\sin x - 2\cos x\).
\(\dfrac{\mathrm{d}y}{\mathrm{d}x} = 3\cos x + 2\sin x\).
2 Differentiate \(y = \cos(4 - 2x)\).
The inside has derivative \(-2\): \(\;\dfrac{\mathrm{d}y}{\mathrm{d}x} = -\sin(4 - 2x) \times (-2) = 2\sin(4 - 2x)\).
3 Differentiate \(y = \sin^2 x\), and show that your answer equals \(\sin 2x\).
\(\dfrac{\mathrm{d}y}{\mathrm{d}x} = 2\sin x \times \cos x = 2\sin x\cos x = \sin 2x\) (double angle identity).
4 Find \(f'(x)\) if \(f(x) = x^2\sin 3x\).
Product rule: \(\;f'(x) = 2x\sin 3x + 3x^2\cos 3x\).
5 Show that \(\dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{\cos x}{1 + \sin x}\right) = -\dfrac{1}{1 + \sin x}\).
\[ \frac{(1 + \sin x)(-\sin x) - \cos x\cos x}{(1 + \sin x)^2} = \frac{-\sin x - (\sin^2 x + \cos^2 x)}{(1 + \sin x)^2} = \frac{-(1 + \sin x)}{(1 + \sin x)^2} = -\frac{1}{1 + \sin x} . \]
6 Find the gradient of the curve \(y = \sin 2x + \cos x\) at the point where \(x = \dfrac{\pi}{6}\).
\(\dfrac{\mathrm{d}y}{\mathrm{d}x} = 2\cos 2x - \sin x\). At \(x = \dfrac{\pi}{6}\): \(\;2\cos\dfrac{\pi}{3} - \sin\dfrac{\pi}{6} = 1 - \dfrac{1}{2} = \dfrac{1}{2}\).
7 AHL Differentiate
(a) \(\tan 5x\)
(b) \(\sec(2x + 1)\).
(a) \(5\sec^2 5x\). \(\qquad\) (b) \(2\sec(2x + 1)\tan(2x + 1)\).
8 AHL Differentiate \(y = \operatorname{cosec}^3 x\).
\(y = (\operatorname{cosec} x)^3\), so \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = 3\operatorname{cosec}^2 x \times (-\operatorname{cosec} x\cot x) = -3\operatorname{cosec}^3 x\cot x\).
9 AHL Show that \(\dfrac{\mathrm{d}}{\mathrm{d}x}\arctan\left(\dfrac{x}{3}\right) = \dfrac{3}{9 + x^2}\).
\[ \frac{1}{1 + \left(\frac{x}{3}\right)^2} \times \frac{1}{3} = \frac{1}{3\left(1 + \frac{x^2}{9}\right)} = \frac{1}{3 + \frac{x^2}{3}} = \frac{3}{9 + x^2} . \]
10 AHL Differentiate \(y = x\arcsin x\), \(\;|x| < 1\).
Product rule: \(\;\dfrac{\mathrm{d}y}{\mathrm{d}x} = \arcsin x + \dfrac{x}{\sqrt{1 - x^2}}\).