BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

The chain rule and higher derivatives

Proofs of the product and quotient rules, which also extend the power rule to negative powers; the chain rule, which differentiates a function of a function by multiplying the two derivatives; and higher derivatives, with their notations, from u″ to dⁿu/dxⁿ, and the fact that the n-th derivative of xⁿ is n!.

You need this first

Full reading path (3 pages)
  1. The derivative: slope of the tangent line and rate of change (18.01)
  2. Limits and continuity (18.01)
  3. Derivatives of sine and cosine, and the product and quotient rules (18.01)
On this page · 7 sections
  1. The product rule, once more
  2. The quotient rule and negative powers
  3. The chain rule
  4. Higher derivatives
  5. Notations
  6. The n-th derivative of xⁿ
  7. Summary

Lecture 4 completes the toolkit for differentiating combinations of functions. (The recorded lecture was given by Haynes Miller, substituting for David Jerison.) It proves the product and quotient rules stated at the end of Lecture 3, adds the most powerful rule of all, the chain rule for a function of a function, and ends with derivatives of derivatives.

The product rule, once more#

The rule from Lecture 3, (uv)′=u′v+uv′(uv)' = u'v + uv', already gives derivatives that were out of reach before, such as

A product
ddx(xnsin⁡x)=nxn−1sin⁡x+xncos⁡x\frac{d}{dx}\bigl(x^n\sin x\bigr) = nx^{n-1}\sin x + x^n\cos x
In words

d over d x (x to the power n sine x ) equals n x to the power n minus 1, end of power, sine x plus x to the power n cos x

Longer products can be done one factor at a time. To see why the rule holds, look at how much the product changes when xx changes by Δx\Delta x. Adding and subtracting u(x) v(x+Δx)u(x)\,v(x + \Delta x) splits the change into a change of uu and a change of vv:

Change of a product
Δ(uv)=u(x+Δx) v(x+Δx)−u(x) v(x)=(Δu) v(x+Δx)+u(x) (Δv)\Delta(uv) = u(x+\Delta x)\,v(x+\Delta x) - u(x)\,v(x) = (\Delta u)\,v(x+\Delta x) + u(x)\,(\Delta v)
In words

capital delta (u v) equals u of the quantity x plus capital delta x, v of the quantity x plus capital delta x, minus u(x) v(x) equals ( capital delta u) v of the quantity x plus capital delta x, plus u(x) ( capital delta v)

Divide by Δx\Delta x and let Δx→0\Delta x \to 0. Because vv is differentiable, it is continuous, so v(x+Δx)→v(x)v(x + \Delta x) \to v(x):

Product rule
Δ(uv)Δx=ΔuΔx v(x+Δx)+u ΔvΔx  →  dudx v+u dvdx\frac{\Delta(uv)}{\Delta x} = \frac{\Delta u}{\Delta x}\,v(x+\Delta x) + u\,\frac{\Delta v}{\Delta x} \;\to\; \frac{du}{dx}\,v + u\,\frac{dv}{dx}
In words

capital delta (u v) over the quantity capital delta x, equals capital delta u over the quantity capital delta x, times v the quantity x plus capital delta x, all plus u capital delta v over the quantity capital delta x, goes to d u over d x, times v plus u d v over d x

Source: 18.01 Lecture 4 transcript, pp. 2–3

(The Lecture 3 page gives the notes' version, which splits the same change the other way round, with u(x+Δx)u(x + \Delta x) in the second term, and the rectangle picture; either works.)

The quotient rule and negative powers#

For a quotient, write the new values as u+Δuu + \Delta u and v+Δvv + \Delta v and put the difference over a common denominator. The terms uvuv cancel:

Change of a quotient
Δ(uv)=u+Δuv+Δv−uv=(Δu) v−u (Δv)(v+Δv) v\Delta\left(\frac{u}{v}\right) = \frac{u + \Delta u}{v + \Delta v} - \frac{u}{v} = \frac{(\Delta u)\,v - u\,(\Delta v)}{(v + \Delta v)\,v}
In words

capital delta ( u over v ) equals the quantity u plus capital delta u, all over the quantity v plus capital delta v, minus u over v equals the quantity ( capital delta u) v minus u ( capital delta v), all over the quantity the quantity v plus capital delta v, v

Source: 18.01 Lecture 4 transcript, pp. 3–4

Dividing by Δx\Delta x and letting Δx→0\Delta x \to 0, with Δv→0\Delta v \to 0 because vv is continuous:

Quotient rule
(uv)′=u′v−uv′v2(v≠0)\left(\frac{u}{v}\right)' = \frac{u'v - uv'}{v^2} \qquad (v \neq 0)
In words

( u over v ) prime equals the quantity u prime v minus u v prime, all over v squared (v is not equal to 0)

Source: 18.01 Lecture 4 transcript, pp. 3–4

A first use: take u=1u = 1, so u′=0u' = 0. The derivative of a reciprocal is

Derivative of a reciprocal
(1v)′=−v′v2=−v−2 v′\left(\frac{1}{v}\right)' = -\frac{v'}{v^2} = -v^{-2}\,v'
In words

( 1 over v ) prime equals minus v prime over v squared equals minus v to the power minus 2 v prime

and with v=xnv = x^n this gives the derivative of a negative power:

Negative powers
ddx x−n=−x−2n⋅nxn−1=−n x−n−1\frac{d}{dx}\,x^{-n} = -x^{-2n}\cdot nx^{n-1} = -n\,x^{-n-1}
In words

d over d x x to the power minus n equals minus x to the power minus 2 n times n x to the power n minus 1, end of power, equals minus n x to the power minus n minus 1, end of power

This is exactly the old power rule, ddxxm=mxm−1\frac{d}{dx}x^m = mx^{m-1}, with m=−nm = -n: the rule holds for negative exponents as well as positive ones. The notes reach the same result in two ways (notes, p. 2): writing x−n=(1/x)nx^{-n} = (1/x)^n and using the chain rule below with the derivative of 1/x1/x from Lecture 1, and writing it as 1/u1/u with u=xnu = x^n, as here.

Worked example

A quotient

Differentiate f(x)=xx2+1f(x) = \dfrac{x}{x^2 + 1} and find its slope at x=2x = 2.

Quotient rule

u=xu = x, v=x2+1v = x^2 + 1, so u′=1u' = 1, v′=2xv' = 2x, and f′(x)=(x2+1)−x⋅2x(x2+1)2=1−x2(x2+1)2f'(x) = \dfrac{(x^2 + 1) - x\cdot 2x}{(x^2 + 1)^2} = \dfrac{1 - x^2}{(x^2 + 1)^2}.

At x=2x = 2

f′(2)=1−425=−0.12f'(2) = \dfrac{1 - 4}{25} = -0.12: the graph is falling there.

The chain rule#

Many functions are made by doing one function and then another: a composition. For instance y=(sin⁡t)10y = (\sin t)^{10}, also written sin⁡10t\sin^{10} t, means "take the sine of tt, then the tenth power". The trick is to name the intermediate result:

Naming the inside
x=sin⁡t,y=x10x = \sin t, \qquad y = x^{10}
In words

x equals sine t, y equals x to the power 10

Now yy depends on xx, and xx on tt. For a small change Δt\Delta t, the change in the intermediate variable cancels algebraically:

Proof of the chain rule
ΔyΔt=ΔyΔx ΔxΔt  →  dydt=dydx dxdt\frac{\Delta y}{\Delta t} = \frac{\Delta y}{\Delta x}\,\frac{\Delta x}{\Delta t} \;\to\; \frac{dy}{dt} = \frac{dy}{dx}\,\frac{dx}{dt}
In words

capital delta y over the quantity capital delta t, equals capital delta y over the quantity capital delta x, times capital delta x over the quantity capital delta t, goes to d y over d t equals d y over d x, times d x over d t

As Δt→0\Delta t \to 0, also Δx→0\Delta x \to 0, because xx is a continuous function of tt (notes, p. 1). [This short argument divides by Δx\Delta x, so it assumes Δx≠0\Delta x \neq 0 for small Δt\Delta t; a careful proof also covers the case Δx=0\Delta x = 0, and the rule holds in general.] So the derivative of a composition is the product of the two derivatives: the "dx's cancel". In function notation, with y=f(x)y = f(x) and x=g(t)x = g(t):

Chain rule in function notation
ddt f(g(t))=f′(g(t)) g′(t)\frac{d}{dt}\,f(g(t)) = f'(g(t))\,g'(t)
In words

d over d t f(g(t)) equals f prime (g(t)) g prime (t)

Source: 18.01 Lecture 4 notes, p. 1

Order matters in a composition: with f(x)=sin⁡xf(x) = \sin x and g(x)=x2g(x) = x^2, f(g(x))=sin⁡(x2)f(g(x)) = \sin(x^2) but g(f(x))=sin⁡2xg(f(x)) = \sin^2 x, two different functions (notes, p. 1).

Back to the example: the outside function is the tenth power, the inside one the sine. Differentiate the outside, keeping the inside as it is, then multiply by the derivative of the inside, and finally substitute x=sin⁡tx = \sin t back:

First example
ddt(sin⁡t)10=10x9⋅cos⁡t=10sin⁡9t cos⁡t\frac{d}{dt}(\sin t)^{10} = 10x^9\cdot\cos t = 10\sin^9 t\,\cos t
In words

d over d t ( sine t) to the power 10 equals 10 x to the power 9 times cos t equals 10 sine to the power 9 t cos t

Source: 18.01 Lecture 4 transcript, pp. 6–7

With practice the intermediate name can stay in your head. For sin⁡(10t)\sin(10t) the outside is the sine and the inside is 10t10t:

Second example
ddtsin⁡(10t)=cos⁡(10t)⋅10=10cos⁡(10t)\frac{d}{dt}\sin(10t) = \cos(10t)\cdot 10 = 10\cos(10t)
In words

d over d t sine (10 t) equals cos (10 t) times 10 equals 10 cos (10 t)

The notes add an example with an inside function u=1/xu = 1/x:

Third example
ddxcos⁡1x=(−sin⁡1x)(−1x2)=1x2sin⁡1x\frac{d}{dx}\cos\frac{1}{x} = \Bigl(-\sin\frac{1}{x}\Bigr)\Bigl(-\frac{1}{x^2}\Bigr) = \frac{1}{x^2}\sin\frac{1}{x}
In words

d over d x cos 1 over x equals (- sine 1 over x ) (- 1 over x squared ) equals 1 over x squared, times sine 1 over x

Source: 18.01 Lecture 4 notes, p. 2
sin⁡(x2)\sin(x^2) and its derivative from the chain rule, 2xcos⁡(x2)2x\cos(x^2), both computed from their formulas. The straight line is the tangent at x=ax = a (slider); its slope equals the height of the dashed curve there (at a=1.5a = 1.5, about −1.88). The inside function x2x^2 makes sin⁡(x2)\sin(x^2) wiggle faster and faster, and the factor 2x2x makes the slopes grow.
Worked example

A power of a polynomial

Differentiate y=(3x2+1)5y = (3x^2 + 1)^5 and evaluate the derivative at x=1x = 1.

Outside and inside

Inside: u=3x2+1u = 3x^2 + 1, with du/dx=6xdu/dx = 6x. Outside: y=u5y = u^5, with dy/du=5u4dy/du = 5u^4.

Multiply

dy/dx=5(3x2+1)4⋅6x=30x (3x2+1)4dy/dx = 5(3x^2 + 1)^4 \cdot 6x = 30x\,(3x^2 + 1)^4.

At x=1x = 1

30⋅1⋅44=30⋅256=768030 \cdot 1 \cdot 4^4 = 30 \cdot 256 = 7680. Multiplying out (3x2+1)5(3x^2 + 1)^5 first and differentiating term by term gives the same, with much more work.

Higher derivatives#

The derivative of a function is a new function, so it can be differentiated again. Doing that over and over gives the higher derivatives: u′′u'' is the second derivative, the third has three primes (also written u(3)u^{(3)}), and after a while one writes u(4)u^{(4)} instead of four primes. For the sine:

Derivatives of the sine
u=sin⁡x,u′=cos⁡x,u′′=−sin⁡x,u(3)=−cos⁡x,u(4)=sin⁡xu = \sin x,\quad u' = \cos x,\quad u'' = -\sin x,\quad u^{(3)} = -\cos x,\quad u^{(4)} = \sin x
In words

u equals sine x, u prime equals cos x, u double prime equals minus sine x, u to the power (3) equals minus cos x, u to the power (4) equals sine x

After four derivatives the sine comes back. That is special to sines and cosines; most functions do not repeat.

Notations#

The derivative can be seen as an operator: something applied to a function to make a new function. It is written ddx\frac{d}{dx}, or simply DD. The second derivative is that operator applied twice, and the notations reflect it:

Notations for the second derivative
u′′=ddxdudx=(ddx)2u=d2dx2 u=d2udx2=D2uu'' = \frac{d}{dx}\frac{du}{dx} = \Bigl(\frac{d}{dx}\Bigr)^2 u = \frac{d^2}{dx^2}\,u = \frac{d^2u}{dx^2} = D^2u
In words

u double prime equals d over d x d u over d x equals ( d over d x ) squared u equals d squared over d x squared u equals d squared u over d x squared equals capital D squared u

Source: 18.01 Lecture 4 transcript, pp. 8–9

The last notation is the strangest. Its denominator is (dx)2(dx)^2, part of the symbol for the second derivative; it does not mean d(x2)d(x^2). The third derivative is d3u/dx3=D3ud^3u/dx^3 = D^3u, and the nn-th is written u(n)u^{(n)}, DnuD^n u or dnu/dxnd^nu/dx^n (notes, p. 3).

The n-th derivative of xⁿ#

Differentiate xnx^n again and again, for n=1,2,3,…n = 1, 2, 3, \ldots. Each time the exponent comes down as a factor and drops by one:

Repeated derivatives of a power
Dxn=nxn−1,D2xn=n(n−1)xn−2,D3xn=n(n−1)(n−2)xn−3, …Dx^n = nx^{n-1},\quad D^2x^n = n(n-1)x^{n-2},\quad D^3x^n = n(n-1)(n-2)x^{n-3},\ \ldots
In words

capital D x to the power n equals n x to the power n minus 1, end of power, capital D squared x to the power n equals n the quantity n minus 1, x to the power n minus 2, end of power, capital D cubed x to the power n equals n the quantity n minus 1, the quantity n minus 2, x to the power n minus 3, end of power, and so on

After n−1n - 1 steps only x1x^1 is left, with the factor n(n−1)⋯2n(n-1)\cdots 2 in front, and one more derivative leaves a constant:

The n-th derivative of xⁿ
Dnxn=n(n−1)⋯2⋅1=n!D^n x^n = n(n-1)\cdots 2\cdot 1 = n!
In words

capital D to the power n x to the power n equals n the quantity n minus 1, and so on 2 times 1 equals n factorial

the number called n factorial. The notes prove it by induction: it is true for n=1n = 1, since Dx=1Dx = 1; and if it holds for nn, then Dn+1xn+1=Dn((n+1)xn)=(n+1) Dnxn=(n+1)⋅n!D^{n+1}x^{n+1} = D^n\bigl((n+1)x^n\bigr) = (n+1)\,D^n x^n = (n+1)\cdot n!, which is the factorial of n+1n + 1 (notes, p. 3). One derivative more, Dn+1xnD^{n+1}x^n, is the derivative of a constant: 0.

Worked example

Higher derivatives of x⁵

Find the third derivative of x5x^5 at x=1x = 1, and the fifth derivative.

Third derivative

Dx5=5x4D x^5 = 5x^4, D2x5=20x3D^2 x^5 = 20x^3, D3x5=60x2D^3 x^5 = 60x^2; at x=1x = 1 this is 60.

Fifth derivative

D5x5=5!=5⋅4⋅3⋅2⋅1=120D^5 x^5 = 5! = 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 120, a constant; the sixth derivative is 0.

Summary#

  • Product rule: Δ(uv)=(Δu) v(x+Δx)+u Δv\Delta(uv) = (\Delta u)\,v(x + \Delta x) + u\,\Delta v gives (uv)′=u′v+uv′(uv)' = u'v + uv'; continuity of vv is used in the limit.
  • Quotient rule: (u/v)′=(u′v−uv′)/v2(u/v)' = (u'v - uv')/v^2; with u=1u = 1, (1/v)′=−v′/v2(1/v)' = -v'/v^2, so ddxx−n=−nx−n−1\frac{d}{dx}x^{-n} = -nx^{-n-1}: the power rule holds for negative powers too.
  • Chain rule: for y=f(x)y = f(x), x=g(t)x = g(t), dydt=dydx dxdt\dfrac{dy}{dt} = \dfrac{dy}{dx}\,\dfrac{dx}{dt}, or (f(g(t)))′=f′(g(t)) g′(t)(f(g(t)))' = f'(g(t))\,g'(t); differentiate the outside, keep the inside, multiply by the derivative of the inside.
  • Higher derivatives: u′′u'', u(3)u^{(3)}, u(n)=Dnu=dnu/dxnu^{(n)} = D^nu = d^nu/dx^n; sine repeats after four derivatives.
  • Dnxn=n!D^nx^n = n! (by induction), and Dn+1xn=0D^{n+1}x^n = 0.

Symbols on this page

Show the 27 symbols used here
α\alpha alpha.
In the cosmology note, the constant that sets the size of the closed universe's cycloid. Unit: m. Say it: “alpha”.
Δ\Delta capital delta.
A change or difference in a quantity, e.g. Δx = x₂ − x₁. Say it: “capital delta”.
θ\theta theta.
In the cosmology note, the parameter (development angle) of the closed universe's cycloid. Unit: rad. Say it: “theta” (sounds like “thay-ta or thee-ta”).
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
sin⁡\sin sine.
Sine of an angle. Say it: “sine”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
aa a.
In the graph, the point where the tangent is drawn; in the cosmology note, the scale factor. Say it: “a”.
cc c.
In the cosmology note, the speed of light. Unit: m/s. Say it: “c”.
kk k.
In the cosmology note, the curvature constant of the closed universe (positive). Unit: 1/notch². Say it: “k”.
xx x.
The variable of the functions; in the chain rule, also the intermediate variable, as in x = sin t. Say it: “x”.
yy y.
The function being differentiated, y = f(x) with x = g(t). Say it: “y”.
tt t.
The variable of the original function in the chain rule (x = g(t)); in the cosmology note, cosmic time. Say it: “t”.
dd d.
The d of a derivative, as in dy/dt, d/dx and d²u/dx². Say it: “d”.
nn n.
A positive whole number: the power in xⁿ (and in x⁻ⁿ, whose exponent −n is negative), and the number of derivatives in Dⁿ. Say it: “n”.
mm m.
An exponent in the power rule d/dx xᵐ = m xᵐ⁻¹, here m = −n. Say it: “m”.
ff f.
The outside function of a composition, y = f(x); in the quotient example, f(x) = x/(x² + 1). Say it: “f”.
gg g.
The inside function of a composition, x = g(t). Say it: “g”.
vv v.
A second function of x in the product and quotient rules; in the quotient rule, the denominator. Say it: “v”.
DD D.
The differentiation operator d/dx: Du = u′, D²u = u″, Dⁿu the n-th derivative. Say it: “capital D”.
f′f' f prime.
The derivative of a function f, evaluated at the inside value in f′(g(t)). Say it: “f prime”.
uu u.
A function of x: in the product and quotient rules and the higher derivatives (u = sin x in the example); in the notes' third example the inside function u = 1/x, in the polynomial example u = 3x² + 1. Say it: “u”.
u′u' u prime.
The derivative of u, du/dx. Say it: “u prime”.
v′v' v prime.
The derivative of v, dv/dx. Say it: “v prime”.
u′′u'' u double prime.
The second derivative of u: u′ differentiated again, d²u/dx². Say it: “u double prime”.
g′g' g prime.
The derivative of the inside function g. Say it: “g prime”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 22 words used here

New here

composition.
Doing one function and then another to its result, as in sin(x²): the inner function's output is the outer function's input.
operator.
A rule that acts on a function, vector or state and turns it into another one, such as 'take the derivative'.
factorial.
The product of all the whole numbers from 1 up to n, written n!; for example 4! = 24.
induction.
A way to prove a statement for every whole number n: prove it for n = 1, then show that each case implies the next.

Also used

differentiation.
Finding a derivative: working out how fast a function changes. Explained in The derivative: slope of the tangent line and rate of change.
chain rule.
The rule for the derivative of a function of a function: multiply the derivative of the outer one by that of the inner one. Explained in Circular motion: polar coordinates, position and velocity.
derivative.
The rate at which a function changes as its input changes: the slope of its graph at a point. Explained in Position and velocity in one dimension.
differentiable.
Having a derivative: at that point the graph has a single, definite, non-vertical tangent line, with no corner or break. Explained in The mean value theorem and inequalities.
continuous.
Without breaks, gaps or jumps: a continuous graph can be drawn without lifting the pen; a continuous quantity can take every value in a range. Explained in The rocket equation.
power rule.
The rule that the derivative of xⁿ is n xⁿ⁻¹; read backwards, it integrates powers of x.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
graph.
The picture of a function: the curve y = f(x) for one variable, or the surface z = f(x, y) for two. Explained in Graphs, straight lines and slope.
proof.
A chain of reasoning showing beyond doubt that a statement follows from definitions and results already known. Explained in Limits and continuity.
second derivative.
The derivative of a derivative: how fast a rate of change itself is changing. Explained in Acceleration in one dimension.
closed universe.
A universe with more than the critical density, whose space curves back on itself like a sphere, so it is finite. Explained in Open, closed and flat universes.
product rule.
The rule for the derivative of a product of two functions: (fg)′ = f′g + fg′. Explained in Circular motion: tangential acceleration and angular acceleration.
limit.
The value a quantity gets closer and closer to, as near as we like, as its input approaches some value, without having to reach it. Explained in Rates of change and area under a graph.
quotient rule.
The rule for the derivative of a fraction of two functions: (u/v)′ = (u′v − uv′)/v².

Academic

toolkit.
A set of methods that can be used together to solve a family of problems.
argument.
A chain of reasoning that leads to a conclusion; in maths also the input of a function, such as x in sin x.
assumption.
Something accepted as true, without proof, so that an argument or calculation can proceed; to assume is to accept it so.
notation.
A system of symbols used to write ideas down briefly, such as dy/dx for a derivative.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

33 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. What is ddtsin⁡(10t)\dfrac{d}{dt}\sin(10t)?
  2. Using the quotient rule with u=1u = 1, what is the derivative of 1/v1/v?
  3. What is ddxx−3\dfrac{d}{dx}x^{-3}?
  4. What is the fourth derivative of sin⁡x\sin x?
  5. What is D5x5D^5 x^5, the fifth derivative of x5x^5?
0 of 5 answered

Flashcards

1 / 4