← Engineering Mathematics

Reference Sheet: Programme F.12 — Differentiation

Compact rules and procedures, in the order of the book's programme. Every rule links to the unit in the lesson that derives it — if a rule here looks arbitrary, the link is where it stops being arbitrary.

Notation: \delta x is a small finite change; \frac{dy}{dx} is the derivative. The book also writes dx, dy for the rise and run along the tangent (the "differentials"), and uses f'(x) only from the Newton–Raphson section onwards.


1. The gradient of a straight line

Derived in Unit 01.

m=\frac{\text{rise}}{\text{run}}=\frac{y_2-y_1}{x_2-x_1}

with the points taken left to right. Rising to the right gives m>0; falling to the right gives m<0. A straight line has the same gradient everywhere (similar triangles), and y=mx+c has \frac{dy}{dx}=m.

Example. Through (1,2) and (5,10): m=\frac{10-2}{5-1}=2.


2. The gradient of a curve at a point

Derived in Unit 01.

The gradient of a curve at P is the gradient of the tangent at P. A graphical estimate — draw the tangent by eye, read two points on it, divide rise by run — is only as good as the drawing; the algebraic method below is exact.


3. The gradient by algebra: first principles

Derived in Unit 01.

  1. Replace x by x+\delta x and find \delta y=f(x+\delta x)-f(x).
  2. Divide by \delta x.
  3. Let \delta x\to0.
\frac{dy}{dx}=\text{the value }\frac{\delta y}{\delta x}\text{ approaches as }\delta x\to0

Example. y=2x^2+3: \delta y=4x\,\delta x+2\,\delta x^2, \frac{\delta y}{\delta x}=4x+2\,\delta x\to4x. At x=1, gradient 4.


4. Derivatives of powers of x

Derived in Unit 02, completed for every real n in Unit 09.

y \frac{dy}{dx}
c (a constant) 0
ax a
x^n nx^{n-1}
ax^n anx^{n-1}

"The old power comes down in front; the new power is one less." Valid for every real n (with x>0 when n is not a whole number). Rewrite roots and reciprocals as powers first: \sqrt x=x^{1/2}, \frac1{x^3}=x^{-3}.

Example. y=6x^{2/3}: \frac{dy}{dx}=6\cdot\frac23x^{-1/3}=4x^{-1/3}.


5. Differentiating polynomials

Derived in Unit 02.

Differentiate term by term; constants vanish; constant factors stay:

\frac{d}{dx}(u+v)=\frac{du}{dx}+\frac{dv}{dx}

To evaluate a derivative at a point, write it in nested form: a x^3+bx^2+cx+d=\big((ax+b)x+c\big)x+d — one multiplication per coefficient.

Example. y=x^4-3x^3+2x-5: \frac{dy}{dx}=4x^3-9x^2+2=\big((4x-9)x+0\big)x+2. At x=3: (12-9)\times3=9; 9\times3+2=29.


6. Second and higher derivatives

Derived in Unit 03.

\frac{d^2y}{dx^2}=\frac{d}{dx}\left(\frac{dy}{dx}\right),\qquad \frac{d^3y}{dx^3}=\frac{d}{dx}\left(\frac{d^2y}{dx^2}\right)

read "dee two y by dee x squared". Prime notation: f'(x), f''(x), f'''(x). For motion: s\to v=\frac{ds}{dt}\to a=\frac{d^2s}{dt^2}\to j=\frac{d^3s}{dt^3}, each in the previous unit per second.

Example. y=2x^3-5x^2: \frac{dy}{dx}=6x^2-10x, \frac{d^2y}{dx^2}=12x-10, \frac{d^3y}{dx^3}=12.


7. The limit of \frac{\sin\theta}{\theta}

Derived in Unit 04.

\cos\theta<\frac{\sin\theta}{\theta}<1\quad(0<\theta<\frac\pi2),\qquad\text{so}\qquad \frac{\sin\theta}{\theta}\to1\ \text{as}\ \theta\to0

\theta in radians. The squeeze comes from the areas \frac12\sin\theta<\frac12\theta<\frac12\tan\theta of a triangle, a sector and a larger triangle; the sector area \frac12r^2\theta holds only in radians.


8. Standard derivatives: \sin x, \cos x, e^x

Derived in Unit 04 and Unit 05.

y \frac{dy}{dx}
\sin x \cos x
\cos x -\sin x
e^x e^x

x in radians for the trigonometric rows.

Example. y=4\cos x+3e^x: \frac{dy}{dx}=-4\sin x+3e^x; at x=0, 3.


9. The derivative of a product

Derived in Unit 06.

\frac{d}{dx}(uv)=u\frac{dv}{dx}+v\frac{du}{dx}

"First times derivative of the second, plus second times derivative of the first."

Example. y=x^3e^x: \frac{dy}{dx}=x^3e^x+3x^2e^x=x^2e^x(x+3).


10. The derivative of a quotient

Derived in Unit 07.

\frac{d}{dx}\left(\frac uv\right)=\frac{v\frac{du}{dx}-u\frac{dv}{dx}}{v^2}\qquad(v\neq0)

"Bottom times derivative of top, minus top times derivative of bottom, all over bottom squared." The order in the numerator matters.

\frac{d}{dx}\tan x=\sec^2x=\frac1{\cos^2x}

Example. y=\frac{x}{x+2}: \frac{dy}{dx}=\frac{(x+2)(1)-x(1)}{(x+2)^2}=\frac2{(x+2)^2}.


11. The derivative of a function of a function

Derived in Unit 08 and, for \ln, Unit 09.

\frac{dy}{dx}=\frac{dy}{du}\cdot\frac{du}{dx}

Differentiate the outside as if the inside were a single variable, then multiply by the derivative of the inside. At sight, with F a function of x:

y \frac{dy}{dx}
F^n nF^{n-1}\frac{dF}{dx}
aF^n anF^{n-1}\frac{dF}{dx}
\sin F \cos F\,\frac{dF}{dx}
\cos F -\sin F\,\frac{dF}{dx}
\tan F \sec^2F\,\frac{dF}{dx}
e^F e^F\frac{dF}{dx}
\ln F \frac1F\frac{dF}{dx}

and in particular \frac{d}{dx}\ln x=\frac1x (x>0).

Examples. \cos(4x-1)\to-4\sin(4x-1). (2x^2+1)^3\to3(2x^2+1)^2\cdot4x=12x(2x^2+1)^2. \ln(\sin x)\to\frac{\cos x}{\sin x}=\cot x.


12. The derivative of a^x

Derived in Unit 09.

\frac{d}{dx}a^x=a^x\ln a\qquad(a>0)

because a^x=e^{x\ln a}. The e^x rule is the case a=e, where \ln e=1.

Example. \frac{d}{dx}10^x=10^x\ln10\approx2.3026\times10^x.


13. The Newton–Raphson method

Derived in Unit 10.

Notation. f'(x) is \frac{dy}{dx} for y=f(x).

Derivation, in one line. The tangent at \big(x_n,f(x_n)\big) crosses the axis a run \frac{f(x_n)}{f'(x_n)} away:

x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}

Tabular display. Columns n, x_n, f(x_n), f'(x_n); each row's x comes from the row above. In a spreadsheet, the x cell of each row is previous x − previous f / previous f', filled down. Stop when x_n repeats to the accuracy required.

First approximations. Find x_0 by a sign change — evaluate f at 0,\pm1,\pm2,\dots until two neighbouring values differ in sign — or by sketching. For a transcendental equation, rewrite it as two graphs (e.g. e^x=2-x) and read the crossing.

Failure modes.

  • f'(x_n)=0: division by zero.
  • f'(x_n) small: the tangent is nearly flat and throws the next estimate far away, possibly to a different root.
  • A root that is physically meaningless: always check the answer against the problem.

Example. x^3-7=0 from x_0=2, with f'(x)=3x^2: see Self-check Q8.


Traps

  • Radians. \frac{d}{dx}\sin x=\cos x only when x is in radians. In degrees it gains a factor \frac{\pi}{180}.
  • The product of derivatives. \frac{d}{dx}(uv)\ne\frac{du}{dx}\cdot\frac{dv}{dx}. Units expose it: the product of two rates has the wrong units.
  • Quotient sign order. v\,u'-u\,v', not u\,v'-v\,u': swapping them flips the sign of the answer.
  • The forgotten inside. \frac{d}{dx}\sin3x=3\cos3x, not \cos3x. Every function of a function needs its inside's derivative.
  • Power rule on a variable exponent. \frac{d}{dx}2^x\ne x\,2^{x-1}; use a^x\ln a.
  • Constants. \frac{d}{dx}(5)=0, but \frac{d}{dx}(5x)=5, and \frac{d}{dx}e^2=0 — e^2 is a number.
  • Newton–Raphson from a flat start. A starting value near a turning point can send the iteration to another root, or off to infinity.

Self-check

Q1. Find the gradient of the line through (-1,4) and (3,-2).

Q2. Differentiate y=3x^2-x from first principles and find the gradient at x=2.

Q3. For y=x^5-4x^3+2x-1, find \frac{dy}{dx} and \frac{d^2y}{dx^2} at x=-1.

Q4. Differentiate y=4\sqrt x-\frac3{x^2} and evaluate at x=4.

Q5. Differentiate y=x^3\sin x.

Q6. Differentiate y=\frac{e^x}{x^2+1} and find where the gradient is zero.

Q7. Differentiate (a) (2x-3)^5, (b) e^{-2x}\cos x, (c) \ln(5x+2), (d) 3^x.

Q8. Use Newton–Raphson, starting from x_0=2, to solve x^3-7=0 to six decimal places.

Q9. A carriage moves with s=5t^2-t^3 metres. Find its velocity and acceleration at t=2 s, and the time at which it stops.

Solutions

Q1. m=\frac{-2-4}{3-(-1)}=\frac{-6}{4}=-1.5. The line falls to the right.

Q2. \delta y=3(x+\delta x)^2-(x+\delta x)-3x^2+x=6x\,\delta x+3\,\delta x^2-\delta x. Dividing, \frac{\delta y}{\delta x}=6x-1+3\,\delta x\to6x-1. At x=2: 12-1=11.

Q3. \frac{dy}{dx}=5x^4-12x^2+2; at x=-1: 5-12+2=-5. \frac{d^2y}{dx^2}=20x^3-24x; at x=-1: -20+24=4.

Q4. y=4x^{1/2}-3x^{-2}, so \frac{dy}{dx}=2x^{-1/2}+6x^{-3}=\frac2{\sqrt x}+\frac6{x^3}. At x=4: \frac22+\frac6{64}=1+0.09375=1.09375.

Q5. Product rule with u=x^3, v=\sin x: \frac{dy}{dx}=x^3\cos x+3x^2\sin x=x^2(x\cos x+3\sin x).

Q6. Quotient rule with u=e^x, v=x^2+1:

\frac{dy}{dx}=\frac{(x^2+1)e^x-e^x\cdot2x}{(x^2+1)^2}=\frac{e^x(x^2-2x+1)}{(x^2+1)^2}=\frac{e^x(x-1)^2}{(x^2+1)^2}.

e^x and the denominator are never zero, so the gradient is zero only where (x-1)^2=0: at x=1. Everywhere else it is positive.

Q7. (a) 5(2x-3)^4\times2=10(2x-3)^4. (b) Product and chain: e^{-2x}(-\sin x)+\cos x\cdot(-2e^{-2x})=-e^{-2x}(\sin x+2\cos x). At x=0: -2. (c) \frac1{5x+2}\times5=\frac5{5x+2}. (d) 3^x\ln3.

Q8. f(x)=x^3-7, f'(x)=3x^2.

n x_n f(x_n) f'(x_n)
0 2.0000000 1.0000000 12.0000000
1 1.9166667 0.0410880 11.0208333
2 1.9129385 0.0000799 10.9780006
3 1.9129312 0.0000000 10.9779171
4 1.9129312 0.0000000 10.9779171

x=1.912931 to six decimal places — the cube root of 7.

Q9. v=\frac{ds}{dt}=10t-3t^2; at t=2: 20-12=8 m/s. a=\frac{dv}{dt}=10-6t; at t=2: 10-12=-2 m/s², so it is already slowing. It stops when v=0: t(10-3t)=0, so at t=0 (the start) and at t=\frac{10}{3}=3.33 s, having travelled s=5\left(\frac{10}{3}\right)^2-\left(\frac{10}3\right)^3=18.52 m.