Fifteen worked examples covering all the combinations of elementary functions encountered in Year 5. They form a reference catalogue to review before assessments; each example applies only one idea beyond the previous ones.

Example 1 — Polynomial inside sine: f(x)=sin(x2)f(x)=\sin(x^2)

f(x)=cos(x2)2xf'(x)=\cos(x^2)\cdot 2x.

Example 2 — Exponential inside cosine: f(x)=ecosxf(x)=e^{\cos x}

f(x)=ecosx(sinx)=sinxecosxf'(x)=e^{\cos x}\cdot(-\sin x) = -\sin x\,e^{\cos x}.

Example 3 — Logarithm of a polynomial: f(x)=ln(1+x2)f(x)=\ln(1+x^2)

f(x)=11+x22x=2x1+x2f'(x)=\dfrac{1}{1+x^2}\cdot 2x = \dfrac{2x}{1+x^2}.

Example 4 — Arctangent of an exponential: f(x)=arctan(ex)f(x)=\arctan(e^x)

f(x)=11+e2xex=ex1+e2xf'(x)=\dfrac{1}{1+e^{2x}}\cdot e^x = \dfrac{e^x}{1+e^{2x}}.

Example 5 — Root of a rational function: f(x)=1+x1xf(x)=\sqrt{\dfrac{1+x}{1-x}}

Set u=(1+x)/(1x)u=(1+x)/(1-x): u=(1)(1x)(1+x)(1)(1x)2=2(1x)2u'=\dfrac{(1)(1-x)-(1+x)(-1)}{(1-x)^2}=\dfrac{2}{(1-x)^2}. Then f(x)=12uu=121x1+x2(1x)2=1(1x)21x1+x.f'(x)=\frac{1}{2\sqrt{u}}\cdot u' = \frac{1}{2}\sqrt{\frac{1-x}{1+x}}\cdot\frac{2}{(1-x)^2} = \frac{1}{(1-x)^2}\sqrt{\frac{1-x}{1+x}}.

Example 6 — Cosine of sine: f(x)=cos(sinx)f(x)=\cos(\sin x)

f(x)=sin(sinx)cosxf'(x)=-\sin(\sin x)\cdot\cos x.

Example 7 — Exponential of a quadratic: f(x)=ex2f(x)=e^{-x^2} (the Gaussian)

f(x)=ex2(2x)=2xex2f'(x)=e^{-x^2}\cdot(-2x)=-2x\,e^{-x^2}.

Example 8 — Iterated logarithm: f(x)=ln(lnx)f(x)=\ln(\ln x), x>1x>1

f(x)=1lnx1x=1xlnxf'(x)=\dfrac{1}{\ln x}\cdot\dfrac{1}{x}=\dfrac{1}{x\ln x}.

Example 9 — Sine of a logarithm: f(x)=sin(lnx)f(x)=\sin(\ln x)

f(x)=cos(lnx)1x=cos(lnx)xf'(x)=\cos(\ln x)\cdot\dfrac{1}{x}=\dfrac{\cos(\ln x)}{x}.

Example 10 — f(x)=tan3(x)f(x)=\tan^3(x)

Set u=tanxu=\tan x: u=1/cos2xu'=1/\cos^2 x. f(x)=3u2u=3tan2x/cos2xf'(x)=3u^2\cdot u'=3\tan^2 x/\cos^2 x.

Example 11 — f(x)=arctan(x)f(x)=\arctan(\sqrt{x})

f(x)=11+x12x=12x(1+x)f'(x)=\dfrac{1}{1+x}\cdot\dfrac{1}{2\sqrt{x}}=\dfrac{1}{2\sqrt{x}(1+x)}.

Example 12 — f(x)=(sinx)cosxf(x)=(\sin x)^{\cos x} (variable exponent, the "log trick")

The function has both base and exponent depending on xx: one applies f=ecosxln(sinx)f=e^{\cos x\,\ln(\sin x)}. f(x)=f(x)[sinxln(sinx)+cosxcosxsinx]=(sinx)cosx[sinxln(sinx)+cos2xsinx].f'(x) = f(x)\cdot\Bigl[-\sin x\,\ln(\sin x) + \cos x\cdot\frac{\cos x}{\sin x}\Bigr] = (\sin x)^{\cos x}\Bigl[-\sin x\,\ln(\sin x) + \frac{\cos^2 x}{\sin x}\Bigr]. This is the logarithmic derivative: whenever one sees fgf^g with both variable, one goes through lnfg=glnf\ln f^g = g\ln f.

Example 13 — f(x)=xxf(x)=x^x (a celebrated case)

lnf=xlnx\ln f = x\ln x. Differentiating both sides: f/f=lnx+1f'/f = \ln x + 1, hence f(x)=xx(lnx+1)f'(x)=x^x(\ln x + 1).

Example 14 — Quadratic + root: f(x)=1+sin2xf(x)=\sqrt{1+\sin^2 x}

f(x)=121+sin2x2sinxcosx=sinxcosx1+sin2x=sin(2x)21+sin2xf'(x)=\dfrac{1}{2\sqrt{1+\sin^2 x}}\cdot 2\sin x\cos x = \dfrac{\sin x\cos x}{\sqrt{1+\sin^2 x}} = \dfrac{\sin(2x)}{2\sqrt{1+\sin^2 x}}.

Example 15 — Triple nesting: f(x)=ln(cos(ex))f(x)=\ln\bigl(\cos(e^x)\bigr)

Three circles: lncosexp\ln\circ\cos\circ\exp. f(x)=1cos(ex)(sin(ex))ex=extan(ex)f'(x) = \dfrac{1}{\cos(e^x)}\cdot(-\sin(e^x))\cdot e^x = -e^x\tan(e^x).

In brief — Recurring patterns

PatternDerivative
sin(φ)\sin(\varphi)cos(φ)φ\cos(\varphi)\cdot\varphi'
cos(φ)\cos(\varphi)sin(φ)φ-\sin(\varphi)\cdot\varphi'
eφe^{\varphi}eφφe^{\varphi}\cdot\varphi'
ln(φ)\ln(\varphi) (φ>0\varphi>0)φ/φ\varphi'/\varphi
φn\varphi^n (nn fixed)nφn1φn\varphi^{n-1}\cdot\varphi'
φ\sqrt{\varphi} (φ>0\varphi>0)φ/(2φ)\varphi'/(2\sqrt{\varphi})
arctan(φ)\arctan(\varphi)φ/(1+φ2)\varphi'/(1+\varphi^2)
fgf^g (both variable)go through eglnfe^{g\ln f} (logarithmic derivative)

Topics: Derivatives
Concepts: Composite derivative · Logarithmic derivative · Chain rule
Skills: Differentiating · Using formulae