The derivative f ′ ( x ) = lim h → 0 f ( x + h ) − f ( x ) h f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} f ′ ( x ) = lim h → 0 h f ( x + h ) − f ( x ) is the instantaneous rate of change — the slope of the tangent. Everything below is machinery for computing it without touching the limit.
d d x x n = n x n − 1 ( c f ) ′ = c f ′ ( f + g ) ′ = f ′ + g ′ \frac{d}{dx}\,x^n = n\,x^{n-1} \qquad (cf)' = c\,f' \qquad (f+g)' = f' + g' d x d x n = n x n − 1 ( c f ) ′ = c f ′ ( f + g ) ′ = f ′ + g ′
Works for all real n n n — rewrite roots and fractions as powers first.
Worked example. f ( x ) = 4 x 3 − 2 x 2 + 3 x f(x) = 4x^3 - \dfrac{2}{x^2} + 3\sqrt{x} f ( x ) = 4 x 3 − x 2 2 + 3 x
Rewrite: f ( x ) = 4 x 3 − 2 x − 2 + 3 x 1 / 2 f(x) = 4x^3 - 2x^{-2} + 3x^{1/2} f ( x ) = 4 x 3 − 2 x − 2 + 3 x 1/2
f ′ ( x ) = 12 x 2 + 4 x − 3 + 3 2 x − 1 / 2 = 12 x 2 + 4 x 3 + 3 2 x f'(x) = 12x^2 + 4x^{-3} + \tfrac{3}{2}x^{-1/2} = 12x^2 + \frac{4}{x^3} + \frac{3}{2\sqrt{x}} f ′ ( x ) = 12 x 2 + 4 x − 3 + 2 3 x − 1/2 = 12 x 2 + x 3 4 + 2 x 3
Differentiate by hand, writing each function as powers first:
a) f ( x ) = 7 x 5 − 3 x 2 + 12 f(x) = 7x^5 - 3x^2 + 12 f ( x ) = 7 x 5 − 3 x 2 + 12
b) g ( x ) = 5 x 3 + x 3 g(x) = \dfrac{5}{x^3} + \sqrt[3]{x} g ( x ) = x 3 5 + 3 x
c) h ( x ) = x 2 + 1 x h(x) = \dfrac{x^2 + 1}{\sqrt{x}} h ( x ) = x x 2 + 1 (split the fraction first)
Get AI feedback…or hover here and press Ctrl+V to paste a screenshot
( f g ) ′ = f ′ g + f g ′ (fg)' = f'g + fg' ( f g ) ′ = f ′ g + f g ′
Worked example. y = x 2 e x y = x^2 e^x y = x 2 e x
y ′ = 2 x e x + x 2 e x = x e x ( 2 + x ) y' = 2x\,e^x + x^2 e^x = x e^x (2 + x) y ′ = 2 x e x + x 2 e x = x e x ( 2 + x )
Recall the standard derivatives you'll combine with it: ( e x ) ′ = e x (e^x)' = e^x ( e x ) ′ = e x , ( ln x ) ′ = 1 x (\ln x)' = \frac1x ( ln x ) ′ = x 1 , ( sin x ) ′ = cos x (\sin x)' = \cos x ( sin x ) ′ = cos x , ( cos x ) ′ = − sin x (\cos x)' = -\sin x ( cos x ) ′ = − sin x .
e x e^x e x — for any base, ( a x ) ′ = a x ln a (a^x)' = a^x \ln a ( a x ) ′ = a x ln a : the exponential reproduces itself up to a constant factor. e ≈ 2.718 e \approx 2.718 e ≈ 2.718 is defined as the base where that factor is 1 1 1 , i.e. the slope of e x e^x e x equals its value everywhere. That self-reproduction is why e x e^x e x shows up in every growth/decay ODE: y ′ = k y ⇒ y = C e k x y' = ky \Rightarrow y = Ce^{kx} y ′ = k y ⇒ y = C e k x .
ln x \ln x ln x — inverse of e x e^x e x . Differentiate e ln x = x e^{\ln x} = x e l n x = x implicitly: e ln x ⋅ ( ln x ) ′ = 1 e^{\ln x} \cdot (\ln x)' = 1 e l n x ⋅ ( ln x ) ′ = 1 , so ( ln x ) ′ = 1 / e ln x = 1 / x (\ln x)' = 1/e^{\ln x} = 1/x ( ln x ) ′ = 1/ e l n x = 1/ x . Same trick gives ( log a x ) ′ = 1 x ln a (\log_a x)' = \frac{1}{x \ln a} ( log a x ) ′ = x l n a 1 .
sin , cos \sin, \cos sin , cos — differentiation is a quarter-turn phase shift: sin x → cos x → − sin x → − cos x → sin x \sin x \to \cos x \to -\sin x \to -\cos x \to \sin x sin x → cos x → − sin x → − cos x → sin x , a cycle of four (equivalently ( sin x ) ′ = sin ( x + π 2 ) (\sin x)' = \sin(x + \tfrac{\pi}{2}) ( sin x ) ′ = sin ( x + 2 π ) ). That's why the second derivative of each is its own negative — the source of y ′ ′ = − ω 2 y y'' = -\omega^2 y y ′′ = − ω 2 y in every oscillator problem.
Differentiate and simplify:
a) f ( x ) = x 3 ln x f(x) = x^3 \ln x f ( x ) = x 3 ln x
b) g ( x ) = e x sin x g(x) = e^x \sin x g ( x ) = e x sin x
c) h ( t ) = ( t 2 + 1 ) ( t 3 − 2 t ) h(t) = (t^2 + 1)(t^3 - 2t) h ( t ) = ( t 2 + 1 ) ( t 3 − 2 t ) — twice: once with the product rule, once by expanding first. Confirm both agree.
Get AI feedback…or hover here and press Ctrl+V to paste a screenshot
( f g ) ′ = f ′ g − f g ′ g 2 \left(\frac{f}{g}\right)' = \frac{f'g - fg'}{g^2} ( g f ) ′ = g 2 f ′ g − f g ′
Numerator order matters — "low d-high minus high d-low".
Worked example. y = sin x x y = \dfrac{\sin x}{x} y = x sin x
y ′ = x cos x − sin x x 2 y' = \frac{x\cos x - \sin x}{x^2} y ′ = x 2 x c o s x − s i n x
a) f ( x ) = x 2 x + 1 f(x) = \dfrac{x^2}{x + 1} f ( x ) = x + 1 x 2
b) g ( x ) = e x x 2 + 1 g(x) = \dfrac{e^x}{x^2 + 1} g ( x ) = x 2 + 1 e x
c) tan x = sin x cos x \tan x = \dfrac{\sin x}{\cos x} tan x = cos x sin x — derive ( tan x ) ′ = 1 cos 2 x (\tan x)' = \dfrac{1}{\cos^2 x} ( tan x ) ′ = cos 2 x 1 yourself.
Get AI feedback…or hover here and press Ctrl+V to paste a screenshot
d d x f ( g ( x ) ) = f ′ ( g ( x ) ) ⋅ g ′ ( x ) \frac{d}{dx} f(g(x)) = f'(g(x)) \cdot g'(x) d x d f ( g ( x )) = f ′ ( g ( x )) ⋅ 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 ( x 2 ) y = \sin(x^2) y = sin ( x 2 ) : outer sin \sin sin , inner x 2 x^2 x 2 :
y ′ = cos ( x 2 ) ⋅ 2 x y' = \cos(x^2) \cdot 2x y ′ = cos ( x 2 ) ⋅ 2 x
Worked example (double chain). y = e cos ( 3 x ) y = e^{\cos(3x)} y = e c o s ( 3 x ) :
y ′ = e cos ( 3 x ) ⋅ ( − sin ( 3 x ) ) ⋅ 3 = − 3 sin ( 3 x ) e cos ( 3 x ) y' = e^{\cos(3x)} \cdot (-\sin(3x)) \cdot 3 = -3\sin(3x)\,e^{\cos(3x)} y ′ = e c o s ( 3 x ) ⋅ ( − sin ( 3 x )) ⋅ 3 = − 3 sin ( 3 x ) e c o s ( 3 x )
a) f ( x ) = ( 2 x 3 − 5 ) 7 f(x) = (2x^3 - 5)^7 f ( x ) = ( 2 x 3 − 5 ) 7
b) g ( x ) = ln ( x 2 + 4 ) g(x) = \ln(x^2 + 4) g ( x ) = ln ( x 2 + 4 )
c) h ( x ) = 1 + e 2 x h(x) = \sqrt{1 + e^{2x}} h ( x ) = 1 + e 2 x
d) k ( x ) = x 2 sin ( 3 x ) k(x) = x^2 \sin(3x) k ( x ) = x 2 sin ( 3 x ) (product and chain)
Get AI feedback…or hover here and press Ctrl+V to paste a screenshot
A derivative is a slope. Change f and a below; the tangent at x = a x = a x = a uses the slope from the rules above.
Python Loading 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()
No scaffolding — pick the right rule(s) yourself.
a) y = ln x x 2 y = \dfrac{\ln x}{x^2} y = x 2 ln x
b) y = e − x 2 / 2 y = e^{-x^2/2} y = e − x 2 /2 (the Gaussian — you will meet it weekly in physics)
c) y = x e x cos x y = x\,e^x \cos x y = x e x cos x (three factors)
d) y = ( x 1 + x ) 3 y = \left(\dfrac{x}{1+x}\right)^3 y = ( 1 + x x ) 3
Get AI feedback…or hover here and press Ctrl+V to paste a screenshot