Ein frei kopier- und anpassbares Lehrmittel von eduskript.org

Derivatives

The derivative f(x)=limh0f(x+h)f(x)hf'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} is the instantaneous rate of change — the slope of the tangent. Everything below is machinery for computing it without touching the limit.

Power rule and linearity

ddxxn=nxn1(cf)=cf(f+g)=f+g\frac{d}{dx}\,x^n = n\,x^{n-1} \qquad (cf)' = c\,f' \qquad (f+g)' = f' + g'

Works for all real nn — rewrite roots and fractions as powers first.

Worked example. f(x)=4x32x2+3xf(x) = 4x^3 - \dfrac{2}{x^2} + 3\sqrt{x}

Rewrite: f(x)=4x32x2+3x1/2f(x) = 4x^3 - 2x^{-2} + 3x^{1/2}

f(x)=12x2+4x3+32x1/2=12x2+4x3+32xf'(x) = 12x^2 + 4x^{-3} + \tfrac{3}{2}x^{-1/2} = 12x^2 + \frac{4}{x^3} + \frac{3}{2\sqrt{x}}

Exercise 1.1

Differentiate by hand, writing each function as powers first:

a) f(x)=7x53x2+12f(x) = 7x^5 - 3x^2 + 12

b) g(x)=5x3+x3g(x) = \dfrac{5}{x^3} + \sqrt[3]{x}

c) h(x)=x2+1xh(x) = \dfrac{x^2 + 1}{\sqrt{x}} (split the fraction first)

…or hover here and press Ctrl+V to paste a screenshot

Product rule

(fg)=fg+fg(fg)' = f'g + fg'

Worked example. y=x2exy = x^2 e^x

y=2xex+x2ex=xex(2+x)y' = 2x\,e^x + x^2 e^x = x e^x (2 + x)

Recall the standard derivatives you'll combine with it: (ex)=ex(e^x)' = e^x, (lnx)=1x(\ln x)' = \frac1x, (sinx)=cosx(\sin x)' = \cos x, (cosx)=sinx(\cos x)' = -\sin x.

Where these come from

exe^x — for any base, (ax)=axlna(a^x)' = a^x \ln a: the exponential reproduces itself up to a constant factor. e2.718e \approx 2.718 is defined as the base where that factor is 11, i.e. the slope of exe^x equals its value everywhere. That self-reproduction is why exe^x shows up in every growth/decay ODE: y=kyy=Cekxy' = ky \Rightarrow y = Ce^{kx}.

lnx\ln x — inverse of exe^x. Differentiate elnx=xe^{\ln x} = x implicitly: elnx(lnx)=1e^{\ln x} \cdot (\ln x)' = 1, so (lnx)=1/elnx=1/x(\ln x)' = 1/e^{\ln x} = 1/x. Same trick gives (logax)=1xlna(\log_a x)' = \frac{1}{x \ln a}.

sin,cos\sin, \cos — differentiation is a quarter-turn phase shift: sinxcosxsinxcosxsinx\sin x \to \cos x \to -\sin x \to -\cos x \to \sin x, a cycle of four (equivalently (sinx)=sin(x+π2)(\sin x)' = \sin(x + \tfrac{\pi}{2})). That's why the second derivative of each is its own negative — the source of y=ω2yy'' = -\omega^2 y in every oscillator problem.

Exercise 1.2

Differentiate and simplify:

a) f(x)=x3lnxf(x) = x^3 \ln x

b) g(x)=exsinxg(x) = e^x \sin x

c) h(t)=(t2+1)(t32t)h(t) = (t^2 + 1)(t^3 - 2t) — twice: once with the product rule, once by expanding first. Confirm both agree.

…or hover here and press Ctrl+V to paste a screenshot

Quotient rule

(fg)=fgfgg2\left(\frac{f}{g}\right)' = \frac{f'g - fg'}{g^2}

Numerator order matters — "low d-high minus high d-low".

Worked example. y=sinxxy = \dfrac{\sin x}{x}

y=xcosxsinxx2y' = \frac{x\cos x - \sin x}{x^2}

Exercise 1.3

a) f(x)=x2x+1f(x) = \dfrac{x^2}{x + 1}

b) g(x)=exx2+1g(x) = \dfrac{e^x}{x^2 + 1}

c) tanx=sinxcosx\tan x = \dfrac{\sin x}{\cos x} — derive (tanx)=1cos2x(\tan x)' = \dfrac{1}{\cos^2 x} yourself.

…or hover here and press Ctrl+V to paste a screenshot

Chain rule

ddxf(g(x))=f(g(x))g(x)\frac{d}{dx} f(g(x)) = f'(g(x)) \cdot g'(x)

Differentiate the outer function at the inner one, times the derivative of the inner. For nested compositions, work outside-in.

Worked example. y=sin(x2)y = \sin(x^2): outer sin\sin, inner x2x^2:

y=cos(x2)2xy' = \cos(x^2) \cdot 2x

Worked example (double chain). y=ecos(3x)y = e^{\cos(3x)}:

y=ecos(3x)(sin(3x))3=3sin(3x)ecos(3x)y' = e^{\cos(3x)} \cdot (-\sin(3x)) \cdot 3 = -3\sin(3x)\,e^{\cos(3x)}

Exercise 1.4

a) f(x)=(2x35)7f(x) = (2x^3 - 5)^7

b) g(x)=ln(x2+4)g(x) = \ln(x^2 + 4)

c) h(x)=1+e2xh(x) = \sqrt{1 + e^{2x}}

d) k(x)=x2sin(3x)k(x) = x^2 \sin(3x) (product and chain)

…or hover here and press Ctrl+V to paste a screenshot

See it

A derivative is a slope. Change f and a below; the tangent at x=ax = a uses the slope from the rules above.

PythonLoading editor…
import numpy as np
import matplotlib.pyplot as plt

f = lambda x: x**3 - 2*x       # try your own function
df = lambda x: 3*x**2 - 2      # ... and its derivative
a = 1.0                        # point of tangency

x = np.linspace(-2.5, 2.5, 400)
tangent = f(a) + df(a) * (x - a)

plt.plot(x, f(x), label='f(x)')
plt.plot(x, tangent, '--', label=f'tangent at x={a}, slope={df(a):.2f}')
plt.scatter([a], [f(a)], zorder=3)
plt.ylim(-6, 6)
plt.legend()
plt.grid(True)
plt.show()

Mixed practice

No scaffolding — pick the right rule(s) yourself.

a) y=lnxx2y = \dfrac{\ln x}{x^2}

b) y=ex2/2y = e^{-x^2/2} (the Gaussian — you will meet it weekly in physics)

c) y=xexcosxy = x\,e^x \cos x (three factors)

d) y=(x1+x)3y = \left(\dfrac{x}{1+x}\right)^3

…or hover here and press Ctrl+V to paste a screenshot