6B

Differentiating trigonometric functions

The derivatives of sin x, cos x and tan x in radians, the chain rule standard forms, and differentiating products, quotients, powers and compositions involving trigonometric functions.

Calculus with polynomials, exponentials and logs gives you the tools. Now sine and cosine join in, and they turn out to be the neatest functions of all: each one's derivative is the other, give or take a minus sign.

The three standard derivatives

Look at the gradient of $y = \sin x$ as you move along it. At $x = 0$ it climbs most steeply. At $x = \tfrac{\pi}{2}$, the top of the hill, the gradient is $0$. At $x = \pi$ it falls most steeply. Plot those gradients and you get another wave, which starts at its highest point. That is the shape of $\cos x$.

The gradient of sin x

Orange: y = sin x. Dashed blue: y = cos x. The readout measures the gradient of the orange curve at P.

Try this

Drag P to $x = 0$, then to $x = \pi$ (about 3.14). Predict each gradient before you look. Then find two places where the gradient is $0$.

Standard derivatives (x in radians)
$$\frac{d}{dx}\sin x = \cos x \qquad \frac{d}{dx}\cos x = -\sin x \qquad \frac{d}{dx}\tan x = \sec^2 x$$

The graph can show the shape is a cosine wave, but not that its height is exactly $1$. That needs the limit $\dfrac{\sin h}{h} \to 1$, which is proved in 6F. The result for $\cos x$ follows by shifting, and $\tan x = \dfrac{\sin x}{\cos x}$ then gives $\sec^2 x$ by the quotient rule.

Example 1●

Differentiate (a) $y = 5\sin x - 2\cos x$ and (b) $y = \tan x + x^2$.

(a) $y' = 5\cos x + 2\sin x$
Differentiate term by term. The derivative of −2cos x is −2 × (−sin x).
(b) $y' = \sec^2 x + 2x$
Standard form for tan, and the power rule for x².

The chain rule forms

For $\sin(\text{something})$, differentiate the outside to get $\cos(\text{same something})$, then multiply by the derivative of the inside. The inside stays the same.

Chain rule forms
$$\frac{d}{dx}\sin f(x) = f'(x)\cos f(x) \qquad \frac{d}{dx}\cos f(x) = -f'(x)\sin f(x) \qquad \frac{d}{dx}\tan f(x) = f'(x)\sec^2 f(x)$$

The most common case is a linear inside, $ax + b$, where the derivative of the inside is just $a$. For example $\dfrac{d}{dx}\sin(ax + b) = a\cos(ax + b)$.

Example 2●●

Differentiate (a) $\cos(3x - \tfrac{\pi}{4})$ (b) $\tan\dfrac{x}{2}$ (c) $\sin(x^3)$ (d) $\cos^2 x$.

(a) $-3\sin\left(3x - \tfrac{\pi}{4}\right)$
The inside 3x − π/4 has derivative 3. Cos becomes −sin.
(b) $\tfrac12\sec^2\dfrac{x}{2}$
x/2 is the inside, with derivative ½.
(c) $3x^2\cos(x^3)$
The inside is x³, with derivative 3x². The inside stays as x³.
(d) $2\cos x \times (-\sin x) = -2\sin x\cos x$
cos²x means (cos x)². The outside is a square: bring down the 2, then multiply by the derivative of cos x.

Products, quotients and other functions

Nothing new here: use the product and quotient rules exactly as before, with the trig derivatives slotted in.

Example 3●●

Differentiate (a) $x^2\sin x$ (b) $e^{2x}\cos x$ (c) $\dfrac{\cos x}{x}$ (d) $\ln(\sin x)$.

(a) $2x\sin x + x^2\cos x$
Product rule u′v + uv′ with u = x², v = sin x.
(b) $2e^{2x}\cos x - e^{2x}\sin x = e^{2x}(2\cos x - \sin x)$
Product rule. The derivative of e^(2x) is 2e^(2x). Factor out the exponential to tidy up.
(c) $\dfrac{-x\sin x - \cos x}{x^2}$
Quotient rule (vu′ − uv′)/v² with u = cos x, v = x.
(d) $\dfrac{\cos x}{\sin x} = \cot x$
Derivative of ln f(x) is f′(x)/f(x). Then cos x ÷ sin x = cot x.

Second derivatives

Differentiate $\sin x$ four times: $\cos x$, $-\sin x$, $-\cos x$, $\sin x$. You are back where you started, and after two steps you had the negative of the original. With $\sin nx$ each step also brings out a factor of $n$.

Example 4●●

Show that $y = 3\sin 2x - \cos 2x$ satisfies $y'' = -4y$.

$y' = 6\cos 2x + 2\sin 2x$
Differentiate once, using the chain rule with inside derivative 2.
$y'' = -12\sin 2x + 4\cos 2x$
Differentiate again.
$y'' = -4(3\sin 2x - \cos 2x) = -4y$
Factor out −4 and compare with y.

Your turn

Find the gradient of $y = x\cos x$ at $x = \pi$.

Show the working

Product rule: $y' = \cos x - x\sin x$. At $x = \pi$: $\cos\pi - \pi\sin\pi = -1 - 0 = -1$.

Flashcards
$dfrac{d}{dx}sin(ax + b)$
$a\cos(ax + b)$
$dfrac{d}{dx}cos(ax + b)$
$-a\sin(ax + b)$
$dfrac{d}{dx} an(ax + b)$
$a\sec^2(ax + b)$
$y = Asin nx + Bcos nx$
$y'' = -n^2y$
Practice
  1. $\dfrac{d}{dx}\cos 4x =$

  2. Find the gradient of $y = \sin 2x$ at $x = 0$.

  3. Find the gradient of $y = 3\tan x$ at $x = \dfrac{\pi}{4}$.

  4. $\dfrac{d}{dx}\sin^2 x =$

  5. Find the derivative of $y = x\cos x$ at $x = 2\pi$.

  6. $\dfrac{d}{dx}\left(e^x\sin x\right) =$

  7. $y = 5\cos 2x$ satisfies $y'' = -ky$. Find $k$.

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

  9. Find the derivative of $y = \ln(\sin x)$ at $x = \dfrac{\pi}{4}$.

  10. Exam style: show that $\dfrac{d}{dx}\left(\dfrac{\sin x}{1 + \cos x}\right) = \dfrac{1}{1 + \cos x}$, then find the value of the derivative at $x = \dfrac{\pi}{2}$.

Formula sheet