Rules of differentiation
A handful of rules, applied repeatedly, differentiate every elementary function. We list them here, prove the chain rule (the most powerful), and assemble a table of standard derivatives. Subsequent subtopics extend the rules to implicit, logarithmic, and parametric forms.
The four basic rules
For differentiable f , g f, g f , g :
Sum rule: ( f ± g ) ′ ( x ) = f ′ ( x ) ± g ′ ( x ) (f \pm g)'(x) = f'(x) \pm g'(x) ( f ± g ) ′ ( x ) = f ′ ( x ) ± g ′ ( x ) .
Constant multiple: ( c f ) ′ ( x ) = c f ′ ( x ) (cf)'(x) = c f'(x) ( c f ) ′ ( x ) = c f ′ ( x ) for constant c c c .
Product rule: ( f g ) ′ ( x ) = f ′ ( x ) g ( x ) + f ( x ) g ′ ( x ) (fg)'(x) = f'(x) g(x) + f(x) g'(x) ( f g ) ′ ( x ) = f ′ ( x ) g ( x ) + f ( x ) g ′ ( x ) .
Quotient rule: ( f g ) ′ ( x ) = f ′ ( x ) g ( x ) − f ( x ) g ′ ( x ) g ( x ) 2 \left(\dfrac{f}{g}\right)'(x) = \dfrac{f'(x) g(x) - f(x) g'(x)}{g(x)^2} ( g f ) ′ ( x ) = g ( x ) 2 f ′ ( x ) g ( x ) − f ( x ) g ′ ( x ) , provided g ( x ) ≠ 0 g(x) \neq 0 g ( x ) = 0 .
The sum rule and constant multiple are immediate from the limit definition. The product rule requires a small trick (add and subtract f ( x + h ) g ( x ) f(x + h) g(x) f ( x + h ) g ( x ) ). The quotient rule follows from product + chain (differentiate f ⋅ ( 1 / g ) f \cdot (1/g) f ⋅ ( 1/ g ) ).
The chain rule
For differentiable f f f and g g g , with f ∘ g f \circ g f ∘ g defined:
( f ∘ g ) ′ ( x ) = f ′ ( g ( x ) ) ⋅ g ′ ( x ) . (f \circ g)'(x) = f'(g(x)) \cdot g'(x). ( f ∘ g ) ′ ( x ) = f ′ ( g ( x )) ⋅ g ′ ( x ) .
In Leibniz notation: d y d x = d y d u ⋅ d u d x \dfrac{dy}{dx} = \dfrac{dy}{du}\cdot \dfrac{du}{dx} d x d y = d u d y ⋅ d x d u , where u = g ( x ) u = g(x) u = g ( x ) and y = f ( u ) y = f(u) y = f ( u ) .
Proof sketch. f ( g ( x + h ) ) − f ( g ( x ) ) h = f ( g ( x + h ) ) − f ( g ( x ) ) g ( x + h ) − g ( x ) ⋅ g ( x + h ) − g ( x ) h \dfrac{f(g(x + h)) - f(g(x))}{h} = \dfrac{f(g(x + h)) - f(g(x))}{g(x + h) - g(x)} \cdot \dfrac{g(x + h) - g(x)}{h} h f ( g ( x + h )) − f ( g ( x )) = g ( x + h ) − g ( x ) f ( g ( x + h )) − f ( g ( x )) ⋅ h g ( x + h ) − g ( x ) . As h → 0 h \to 0 h → 0 , g ( x + h ) → g ( x ) g(x + h) \to g(x) g ( x + h ) → g ( x ) (continuity); the first factor → f ′ ( g ( x ) ) \to f'(g(x)) → f ′ ( g ( x )) , the second → g ′ ( x ) \to g'(x) → g ′ ( x ) .
(A careful proof needs to handle the case g ( x + h ) = g ( x ) g(x + h) = g(x) g ( x + h ) = g ( x ) separately.)
Table of standard derivatives
f ( x ) f(x) f ( x ) f ′ ( x ) f'(x) f ′ ( x ) constant c c c 0 0 0 x n x^n x n n x n − 1 n x^{n-1} n x n − 1 e x e^x e x e x e^x e x a x a^x a x (a > 0)a x ln a a^x \ln a a x ln a ln x \ln x ln x 1 / x 1/x 1/ x log a x \log_a x log a x 1 / ( x ln a ) 1/(x \ln a) 1/ ( x ln a ) sin x \sin x sin x cos x \cos x cos x cos x \cos x cos x − sin x -\sin x − sin x tan x \tan x tan x sec 2 x \sec^2 x sec 2 x cot x \cot x cot x − csc 2 x -\csc^2 x − csc 2 x sec x \sec x sec x sec x tan x \sec x \tan x sec x tan x csc x \csc x csc x − csc x cot x -\csc x \cot x − csc x cot x sin − 1 x \sin^{-1} x sin − 1 x 1 / 1 − x 2 1/\sqrt{1 - x^2} 1/ 1 − x 2 cos − 1 x \cos^{-1} x cos − 1 x − 1 / 1 − x 2 -1/\sqrt{1 - x^2} − 1/ 1 − x 2 tan − 1 x \tan^{-1} x tan − 1 x 1 / ( 1 + x 2 ) 1/(1 + x^2) 1/ ( 1 + x 2 ) cot − 1 x \cot^{-1} x cot − 1 x − 1 / ( 1 + x 2 ) -1/(1 + x^2) − 1/ ( 1 + x 2 ) sec − 1 x \sec^{-1} x sec − 1 x $1/( csc − 1 x \csc^{-1} x csc − 1 x $-1/(
Combining the rules
Most school problems reduce to applying these in combination. Identify the outermost operation first, apply the corresponding rule, and chain through.
For f ( x ) = sin ( x 3 ) f(x) = \sin(x^3) f ( x ) = sin ( x 3 ) : outermost is sin \sin sin . Chain rule: f ′ ( x ) = cos ( x 3 ) ⋅ 3 x 2 f'(x) = \cos(x^3) \cdot 3x^2 f ′ ( x ) = cos ( x 3 ) ⋅ 3 x 2 .
For f ( x ) = x 2 1 + x f(x) = \dfrac{x^2}{1 + x} f ( x ) = 1 + x x 2 : quotient rule. f ′ ( x ) = 2 x ( 1 + x ) − x 2 ( 1 + x ) 2 = x 2 + 2 x ( 1 + x ) 2 f'(x) = \dfrac{2x(1 + x) - x^2}{(1 + x)^2} = \dfrac{x^2 + 2x}{(1 + x)^2} f ′ ( x ) = ( 1 + x ) 2 2 x ( 1 + x ) − x 2 = ( 1 + x ) 2 x 2 + 2 x .
For f ( x ) = e x sin x f(x) = e^{x} \sin x f ( x ) = e x sin x : product. f ′ ( x ) = e x sin x + e x cos x = e x ( sin x + cos x ) f'(x) = e^x \sin x + e^x \cos x = e^x(\sin x + \cos x) f ′ ( x ) = e x sin x + e x cos x = e x ( sin x + cos x ) .
Worked examples
Example 1. Differentiate f ( x ) = ( 3 x + 1 ) 5 f(x) = (3x + 1)^5 f ( x ) = ( 3 x + 1 ) 5 .
Chain: f ′ ( x ) = 5 ( 3 x + 1 ) 4 ⋅ 3 = 15 ( 3 x + 1 ) 4 f'(x) = 5(3x + 1)^4 \cdot 3 = 15(3x + 1)^4 f ′ ( x ) = 5 ( 3 x + 1 ) 4 ⋅ 3 = 15 ( 3 x + 1 ) 4 .
Example 2. Differentiate f ( x ) = sin ( log x ) f(x) = \sin(\log x) f ( x ) = sin ( log x ) .
Chain: f ′ ( x ) = cos ( log x ) ⋅ 1 x f'(x) = \cos(\log x) \cdot \dfrac{1}{x} f ′ ( x ) = cos ( log x ) ⋅ x 1 .
Example 3. Differentiate f ( x ) = e x 2 + 1 f(x) = e^{x^2 + 1} f ( x ) = e x 2 + 1 .
Chain: f ′ ( x ) = e x 2 + 1 ⋅ 2 x f'(x) = e^{x^2 + 1} \cdot 2x f ′ ( x ) = e x 2 + 1 ⋅ 2 x .
Example 4. Differentiate f ( x ) = sin x 1 + cos x f(x) = \dfrac{\sin x}{1 + \cos x} f ( x ) = 1 + cos x sin x .
Quotient: f ′ ( x ) = cos x ( 1 + cos x ) − sin x ( − sin x ) ( 1 + cos x ) 2 = cos x + cos 2 x + sin 2 x ( 1 + cos x ) 2 = cos x + 1 ( 1 + cos x ) 2 = 1 1 + cos x f'(x) = \dfrac{\cos x (1 + \cos x) - \sin x (-\sin x)}{(1 + \cos x)^2} = \dfrac{\cos x + \cos^2 x + \sin^2 x}{(1 + \cos x)^2} = \dfrac{\cos x + 1}{(1 + \cos x)^2} = \dfrac{1}{1 + \cos x} f ′ ( x ) = ( 1 + cos x ) 2 cos x ( 1 + cos x ) − sin x ( − sin x ) = ( 1 + cos x ) 2 cos x + cos 2 x + sin 2 x = ( 1 + cos x ) 2 cos x + 1 = 1 + cos x 1 .
Example 5. Differentiate f ( x ) = tan − 1 ( 2 x 1 − x 2 ) f(x) = \tan^{-1}\left(\dfrac{2x}{1 - x^2}\right) f ( x ) = tan − 1 ( 1 − x 2 2 x ) .
Use the identity tan − 1 ( 2 x 1 − x 2 ) = 2 tan − 1 x \tan^{-1}\left(\dfrac{2x}{1 - x^2}\right) = 2 \tan^{-1} x tan − 1 ( 1 − x 2 2 x ) = 2 tan − 1 x for ∣ x ∣ < 1 |x| < 1 ∣ x ∣ < 1 . So f ′ ( x ) = 2 1 + x 2 f'(x) = \dfrac{2}{1 + x^2} f ′ ( x ) = 1 + x 2 2 . (Outside that range a ± π \pm \pi ± π adjustment changes nothing for the derivative.)
Example 6. Differentiate f ( x ) = cos 2 ( x ) f(x) = \cos^2(\sqrt{x}) f ( x ) = cos 2 ( x ) .
Outer: square. Inner: cos \cos cos of x \sqrt{x} x . f ′ ( x ) = 2 cos ( x ) ⋅ ( − sin x ) ⋅ 1 2 x = − sin ( 2 x ) 2 x f'(x) = 2\cos(\sqrt{x}) \cdot (-\sin\sqrt{x}) \cdot \dfrac{1}{2\sqrt{x}} = -\dfrac{\sin(2\sqrt{x})}{2\sqrt{x}} f ′ ( x ) = 2 cos ( x ) ⋅ ( − sin x ) ⋅ 2 x 1 = − 2 x sin ( 2 x ) (using 2 sin θ cos θ = sin 2 θ 2 \sin \theta \cos \theta = \sin 2\theta 2 sin θ cos θ = sin 2 θ ).
Try it yourself
Differentiate f ( x ) = x 7 + 5 x 3 − 2 x f(x) = x^7 + 5x^3 - 2x f ( x ) = x 7 + 5 x 3 − 2 x .
Differentiate f ( x ) = sin x cos x f(x) = \sin x \cos x f ( x ) = sin x cos x using both product rule and double-angle identity.
Differentiate f ( x ) = 1 x 2 + 1 f(x) = \dfrac{1}{x^2 + 1} f ( x ) = x 2 + 1 1 .
Differentiate f ( x ) = tan ( x 2 ) f(x) = \tan(x^2) f ( x ) = tan ( x 2 ) .
Differentiate f ( x ) = e 3 x cos ( 2 x ) f(x) = e^{3x} \cos(2x) f ( x ) = e 3 x cos ( 2 x ) .
Differentiate f ( x ) = ln ( sin x ) f(x) = \ln(\sin x) f ( x ) = ln ( sin x ) .
Differentiate f ( x ) = 1 + x 2 f(x) = \sqrt{1 + x^2} f ( x ) = 1 + x 2 .
Differentiate f ( x ) = ( 1 + x ) ( 1 + x 2 ) ( 1 + x 3 ) f(x) = (1 + x)(1 + x^2)(1 + x^3) f ( x ) = ( 1 + x ) ( 1 + x 2 ) ( 1 + x 3 ) .
Differentiate f ( x ) = x + 1 x − 1 f(x) = \dfrac{x + 1}{x - 1} f ( x ) = x − 1 x + 1 .
Differentiate f ( x ) = sin − 1 ( 2 x 1 − x 2 ) f(x) = \sin^{-1}(2x \sqrt{1 - x^2}) f ( x ) = sin − 1 ( 2 x 1 − x 2 ) for ∣ x ∣ < 1 / 2 |x| < 1/\sqrt 2 ∣ x ∣ < 1/ 2 . (Hint: = 2 sin − 1 x = 2 \sin^{-1} x = 2 sin − 1 x .)
Differentiate f ( x ) = x e − x 2 f(x) = x e^{-x^2} f ( x ) = x e − x 2 .
Differentiate f ( x ) = log ( cos ( x 2 ) ) f(x) = \log(\cos(x^2)) f ( x ) = log ( cos ( x 2 )) .
Differentiate f ( x ) = ( sin x ) 3 ⋅ cos x f(x) = (\sin x)^3 \cdot \cos x f ( x ) = ( sin x ) 3 ⋅ cos x , use product rule.
Differentiate f ( x ) = tan x 1 + tan 2 x f(x) = \dfrac{\tan x}{1 + \tan^2 x} f ( x ) = 1 + tan 2 x tan x , recognising it equals sin x cos x \sin x \cos x sin x cos x .
Pitfalls / Tricks
Chain rule first, simplify later. Many students try to simplify before differentiating and lose track.
For quotient rule, be careful with the sign in the numerator: f ′ g − f g ′ f' g - f g' f ′ g − f g ′ , not f g ′ − f ′ g f g' - f' g f g ′ − f ′ g .
Trig identities can sometimes simplify before differentiating , but only do so when it's obvious.
d d x ( a x ) = a x ln a \dfrac{d}{dx}(a^x) = a^x \ln a d x d ( a x ) = a x ln a , not x a x − 1 x a^{x - 1} x a x − 1 . Mixing power-rule and exp-rule is a frequent error.
For inverse trig derivatives, watch the domain , the formula gives a real number only inside the natural domain.
Next, implicit and logarithmic differentiation.