Skip to content

Unit 3: Differentiation: Composite, Implicit, and Inverse Functions

Calculating Higher-Order Derivatives

Find second and higher derivatives from formulas, tables and implicit equations, read every notation for them, and know when they fail to exist.

Topic 3.6 · 7 min read

The derivative f′f' is a function in its own right, so it has a derivative too. That derivative, the second derivative f′′f'', measures how fast the slope of ff is changing. If ff gives position, f′f' is velocity and f′′f'' is acceleration; on a graph, f′′f'' tells you which way the curve bends.

Differentiating again

The second derivative is the derivative of the first: f′′(x)=ddx[f′(x)]f''(x) = \frac{d}{dx}\big[f'(x)\big], at every xx where f′f' is differentiable. Differentiating f′′f'' gives the third derivative f′′′f''', and so on. Each one is computed with the same rules you already have, applied to the previous derivative.

For f(x)=x4−2x3+5f(x) = x^4 - 2x^3 + 5:

f′(x)=4x3−6x2,f′′(x)=12x2−12x,f′′′(x)=24x−12,f(4)(x)=24,f(5)(x)=0.f'(x) = 4x^3 - 6x^2, \quad f''(x) = 12x^2 - 12x, \quad f'''(x) = 24x - 12, \quad f^{(4)}(x) = 24, \quad f^{(5)}(x) = 0.

Each differentiation lowers the degree of a polynomial by one. So a polynomial of degree nn has a constant nnth derivative, and every derivative after that is 0. The constant comes from the leading term: the 4th derivative of x4x^4 is 4⋅3⋅2⋅1=244\cdot 3\cdot 2\cdot 1 = 24.

The units of f′′f'' are the units of ff divided by the units of xx twice. If s(t)s(t) is a position in meters and tt is in seconds, s′(t)s'(t) is in meters per second, and s′′(t)s''(t) is in meters per second per second (m/s2\text{m/s}^2). Topic 4.2 uses s′′s'' as acceleration, and topic 5.6 reads concavity from the sign of f′′f''.

Notation

Each notation for the first derivative extends to higher ones.

OrderPrime notationWith yyLeibniz notation
firstf′(x)f'(x)y′y'dydx\dfrac{dy}{dx}
secondf′′(x)f''(x)y′′y''d2ydx2\dfrac{d^2y}{dx^2}
thirdf′′′(x)f'''(x)y′′′y'''d3ydx3\dfrac{d^3y}{dx^3}
nnthf(n)(x)f^{(n)}(x)y(n)y^{(n)}dnydxn\dfrac{d^ny}{dx^n}

The Leibniz form comes from applying ddx\frac{d}{dx} to dydx\frac{dy}{dx}: the "dd" is applied twice on top, and dxdx appears twice on the bottom, written dx2dx^2. That dx2dx^2 means (dx)2(dx)^2, not the differential of x2x^2, and d2ydx2\frac{d^2y}{dx^2} is not (dydx)2\left(\frac{dy}{dx}\right)^2.

After three primes, the order goes in parentheses: f(4)(x)f^{(4)}(x), f(5)(x)f^{(5)}(x). The parentheses matter, because f4(x)f^4(x) would be read as [f(x)]4[f(x)]^4. To say "evaluated at x=2x = 2", write f′′(2)f''(2) or d2ydx2∣x=2\left.\dfrac{d^2y}{dx^2}\right|_{x=2}.

When a second derivative doesn't exist

f′′(a)f''(a) exists only if f′f' exists near aa and is differentiable at aa. A function can be differentiable everywhere while its derivative has a corner, and then f′′f'' fails at the corner.

Take f(x)=x∣x∣f(x) = x|x|. For x≥0x \ge 0 it equals x2x^2, and for x<0x < 0 it equals −x2-x^2. Both pieces have slope 0 at x=0x = 0, so f′(0)=0f'(0) = 0, and f′(x)=2xf'(x) = 2x for x>0x > 0 and −2x-2x for x<0x < 0. Together, f′(x)=2∣x∣f'(x) = 2|x|, which is continuous but has a corner at 0. Its slope is 2 just right of 0 and −2-2 just left, so f′′(0)f''(0) does not exist, even though ff looks perfectly smooth at the origin.

When an exam question says ff is "twice differentiable", it is guaranteeing that f′′f'' exists everywhere, which also makes ff and f′f' continuous (topic 2.4).

Patterns in repeated derivatives

Some functions repeat or scale in a predictable way each time you differentiate, so you can jump to any order without computing every step.

  • Exponentials. Each derivative of ekxe^{kx} multiplies by kk, so dndxnekx=knekx\frac{d^n}{dx^n}e^{kx} = k^ne^{kx}. For example, the 10th derivative of e−xe^{-x} is (−1)10e−x=e−x(-1)^{10}e^{-x} = e^{-x}.
  • Sine and cosine. The derivatives of sin⁡x\sin x run cos⁡x\cos x, −sin⁡x-\sin x, −cos⁡x-\cos x, sin⁡x\sin x, and then repeat. Only the remainder of nn divided by 4 matters.
  • Reciprocals. For 1x=x−1\frac{1}{x} = x^{-1}, the power rule pulls down −1-1, then −2-2, then −3-3: the derivatives are −1x2-\frac{1}{x^2}, 2x3\frac{2}{x^3}, −6x4-\frac{6}{x^4}, 24x5\frac{24}{x^5}. The signs alternate and the numerators are 1,2,6,241, 2, 6, 24.

Second derivatives with the other rules

Computing f′′f'' means differentiating f′f', whatever f′f' looks like, so every rule from Units 2 and 3 can appear in the second round.

Simplify the first derivative before differentiating it again. Combining fractions, cancelling and factoring after the first derivative shrinks the second one. Example 1 shows the payoff.

Use the product rule on products inside the first derivative. Differentiating a product uvuv twice gives

(uv)′′=(u′v+uv′)′=u′′v+2u′v′+uv′′,(uv)'' = (u'v + uv')' = u''v + 2u'v' + uv'',

because u′v′u'v' shows up once from each term of (uv)′(uv)'. A chain-rule derivative like 2x g′(x2)2x\,g'(x^2) is itself a product, so its derivative needs the product rule too. Example 3 works through both.

With implicit differentiation (topic 3.2), dydx\frac{dy}{dx} usually contains yy. When you differentiate it again, yy is still a function of xx, so each yy produces a dydx\frac{dy}{dx} by the chain rule. Then you replace that dydx\frac{dy}{dx} with the expression you already found, so the final answer is in terms of xx and yy only. Example 4 is this kind of question.

Worked examples

Worked exampleExample 1: simplify before the second round

Let f(x)=ln⁡(1+x2)f(x) = \ln\left(1 + x^2\right). Find f′′(x)f''(x) and f′′(2)f''(2).

Show solution

By the chain rule, f′(x)=2x1+x2f'(x) = \dfrac{2x}{1+x^2}. This is a quotient, so use the quotient rule:

f′′(x)=2(1+x2)−2x⋅2x(1+x2)2=2−2x2(1+x2)2=2(1−x2)(1+x2)2.f''(x) = \frac{2\left(1+x^2\right) - 2x\cdot 2x}{\left(1+x^2\right)^2} = \frac{2 - 2x^2}{\left(1+x^2\right)^2} = \frac{2\left(1 - x^2\right)}{\left(1+x^2\right)^2}.

At x=2x = 2:

f′′(2)=2(1−4)(1+4)2=−625.f''(2) = \frac{2(1-4)}{(1+4)^2} = -\frac{6}{25}.

The factored form shows at a glance that f′′f'' changes sign at x=±1x = \pm 1, which is what a concavity question (topic 5.6) would ask next.

Worked exampleExample 2: jumping to a high order

Let g(x)=cos⁡(2x)g(x) = \cos(2x). Find g(4)(x)g^{(4)}(x) and g(25)(x)g^{(25)}(x).

Show solution

Each derivative multiplies by 2 (the chain rule factor) and moves one step through the cosine cycle:

g′(x)=−2sin⁡(2x),g′′(x)=−4cos⁡(2x),g′′′(x)=8sin⁡(2x),g(4)(x)=16cos⁡(2x).g'(x) = -2\sin(2x), \quad g''(x) = -4\cos(2x), \quad g'''(x) = 8\sin(2x), \quad g^{(4)}(x) = 16\cos(2x).

After four derivatives the trig function is back to cos⁡(2x)\cos(2x), and the coefficient is 24=162^4 = 16. So every four derivatives multiply gg by 16, and g(24)(x)=224cos⁡(2x)g^{(24)}(x) = 2^{24}\cos(2x), since 24=4⋅624 = 4\cdot 6. One more derivative gives

g(25)(x)=−225sin⁡(2x).g^{(25)}(x) = -2^{25}\sin(2x).

The pattern to use is "a factor of 2 per derivative, and the trig part at step nn is the same as at step n−4n - 4". Writing out four steps and then using the remainder of 25 divided by 4, which is 1, avoids sign errors.

Worked exampleExample 3: second derivatives from a table (no calculator)

The function ff is twice differentiable, with f(1)=4f(1) = 4, f′(1)=3f'(1) = 3 and f′′(1)=−1f''(1) = -1.

(a) Let h(x)=f(x3)h(x) = f\left(x^3\right). Find h′′(1)h''(1).

(b) Let p(x)=[f(x)]2p(x) = [f(x)]^2. Find p′′(1)p''(1).

Show solution

(a) The chain rule gives h′(x)=f′(x3)⋅3x2h'(x) = f'\left(x^3\right)\cdot 3x^2. That is a product of f′(x3)f'\left(x^3\right) and 3x23x^2, so the second round needs the product rule, and differentiating f′(x3)f'\left(x^3\right) needs the chain rule again:

h′′(x)=f′′(x3)⋅3x2⋅3x2+f′(x3)⋅6x=9x4f′′(x3)+6xf′(x3).h''(x) = f''\left(x^3\right)\cdot 3x^2\cdot 3x^2 + f'\left(x^3\right)\cdot 6x = 9x^4f''\left(x^3\right) + 6xf'\left(x^3\right).

At x=1x = 1, the inside is 13=11^3 = 1:

h′′(1)=9(−1)+6(3)=9.h''(1) = 9(-1) + 6(3) = 9.

(b) First, p′(x)=2f(x)f′(x)p'(x) = 2f(x)f'(x). That is a product, so

p′′(x)=2f′(x)f′(x)+2f(x)f′′(x)=2[f′(x)]2+2f(x)f′′(x).p''(x) = 2f'(x)f'(x) + 2f(x)f''(x) = 2[f'(x)]^2 + 2f(x)f''(x).

At x=1x = 1:

p′′(1)=2(3)2+2(4)(−1)=18−8=10.p''(1) = 2(3)^2 + 2(4)(-1) = 18 - 8 = 10.

In both parts, the second derivative depends on f′f' as well as f′′f''. Writing h′′(1)=9f′′(1)h''(1) = 9f''(1) or p′′(1)=2f(1)f′′(1)p''(1) = 2f(1)f''(1) drops a term from the product rule.

Worked exampleExample 4: an implicit second derivative

Consider the curve y2=x3+8y^2 = x^3 + 8.

(a) Show that dydx=3x22y\dfrac{dy}{dx} = \dfrac{3x^2}{2y}.

(b) Find d2ydx2\dfrac{d^2y}{dx^2} in terms of xx and yy.

(c) Find the value of d2ydx2\dfrac{d^2y}{dx^2} at the point (1,3)(1, 3).

Show solution

(a) Differentiate both sides with respect to xx, treating yy as a function of xx:

2ydydx=3x2,dydx=3x22y.2y\frac{dy}{dx} = 3x^2, \qquad \frac{dy}{dx} = \frac{3x^2}{2y}.

(b) Differentiate 3x22y\frac{3x^2}{2y} with the quotient rule. The derivative of the denominator 2y2y is 2dydx2\frac{dy}{dx}, not 0:

d2ydx2=6x⋅2y−3x2⋅2dydx(2y)2=12xy−6x2dydx4y2.\frac{d^2y}{dx^2} = \frac{6x\cdot 2y - 3x^2\cdot 2\frac{dy}{dx}}{(2y)^2} = \frac{12xy - 6x^2\frac{dy}{dx}}{4y^2}.

Now replace dydx\frac{dy}{dx} with 3x22y\frac{3x^2}{2y}, so that 6x2⋅3x22y=9x4y6x^2\cdot\frac{3x^2}{2y} = \frac{9x^4}{y}:

d2ydx2=12xy−9x4y4y2=12xy2−9x44y3,\frac{d^2y}{dx^2} = \frac{12xy - \frac{9x^4}{y}}{4y^2} = \frac{12xy^2 - 9x^4}{4y^3},

where the last step multiplies the top and bottom by yy.

(c) The point is on the curve, since 32=1+83^2 = 1 + 8. Substituting x=1x = 1, y=3y = 3:

d2ydx2=12(1)(9)−9(1)4(27)=99108=1112.\frac{d^2y}{dx^2} = \frac{12(1)(9) - 9(1)}{4(27)} = \frac{99}{108} = \frac{11}{12}.

You can check this by substituting into the unsimplified form instead: at (1,3)(1, 3), dydx=36=12\frac{dy}{dx} = \frac{3}{6} = \frac{1}{2}, and 12(1)(3)−6(1)(12)4(9)=3336=1112\frac{12(1)(3) - 6(1)\left(\frac{1}{2}\right)}{4(9)} = \frac{33}{36} = \frac{11}{12}. When a question asks only for the value at a point, this route (find dydx\frac{dy}{dx} at the point first, then substitute everything) avoids the algebra in (b).

Where students lose points

On the exam

A free-response question that gives dydx\frac{dy}{dx} as an expression in xx and yy (a differential equation or an implicit curve) can ask for d2ydx2\frac{d^2y}{dx^2} next. The method is Example 4(b): differentiate implicitly, then substitute the given dydx\frac{dy}{dx}. Second derivatives of functions known only through tables of values are computed like Example 3. On no-calculator parts, an unsimplified numerical value such as 12(1)(9)−9(1)4(27)\frac{12(1)(9) - 9(1)}{4(27)} is acceptable.

Check yourself

  1. Question 1

    If y=xexy = xe^x, then d2ydx2=\dfrac{d^2y}{dx^2} =

    1. A

      (x+1)ex(x+1)e^x

    2. B

      (x+1)2e2x(x+1)^2e^{2x}

    3. C

      exe^x

    4. D

      (x+2)ex(x+2)e^x

    Show answer

    D

    The product rule gives y′=ex+xex=(x+1)exy' = e^x + xe^x = (x+1)e^x, and again y′′=ex+(x+1)ex=(x+2)exy'' = e^x + (x+1)e^x = (x+2)e^x. Choice A stops at the first derivative, and choice B squares the first derivative instead of differentiating it.

  2. Question 2

    Let f(x)=x5/3f(x) = x^{5/3}. Does f′′(0)f''(0) exist? Explain.

    Show answer

    No. f′(x)=53x2/3f'(x) = \frac{5}{3}x^{2/3} exists everywhere, but f′′(x)=109x−1/3f''(x) = \frac{10}{9}x^{-1/3} is undefined at x=0x = 0.

    The first derivative 53x2/3\frac{5}{3}x^{2/3} is continuous with f′(0)=0f'(0) = 0, but its graph has a cusp with a vertical tangent at the origin, so f′f' is not differentiable at 0. A function can be differentiable everywhere while its second derivative fails at a point.

  3. Question 3

    Let f(x)=sin⁡x+e−xf(x) = \sin x + e^{-x}. What is the smallest positive integer nn for which f(n)(x)=f(x)f^{(n)}(x) = f(x) for all xx?

    Show answer

    n=4n = 4

    The derivatives of sin⁡x\sin x return to sin⁡x\sin x only when nn is a multiple of 4, and the nnth derivative of e−xe^{-x} is (−1)ne−x(-1)^ne^{-x}, which equals e−xe^{-x} only for even nn. Both conditions first hold at n=4n = 4.

  4. Question 4

    A particle moves along a line with position x(t)=2sin⁡(πt)x(t) = 2\sin(\pi t) meters at time tt seconds. What is its acceleration at t=16t = \frac{1}{6}?

    1. A

      π3\pi\sqrt{3} m/s2^2

    2. B

      π2\pi^2 m/s2^2

    3. C

      −π2-\pi^2 m/s2^2

    4. D

      −2π2-2\pi^2 m/s2^2

    Show answer

    C

    Acceleration is the second derivative: x′(t)=2πcos⁡(πt)x'(t) = 2\pi\cos(\pi t) and x′′(t)=−2π2sin⁡(πt)x''(t) = -2\pi^2\sin(\pi t), so x′′(16)=−2π2⋅12=−π2x''\left(\frac{1}{6}\right) = -2\pi^2\cdot\frac{1}{2} = -\pi^2. Choice A is the velocity, and choice D forgets to evaluate sin⁡π6=12\sin\frac{\pi}{6} = \frac{1}{2}.

  5. Question 5

    A function yy satisfies dydx=x+y2\dfrac{dy}{dx} = x + y^2. Find d2ydx2\dfrac{d^2y}{dx^2} in terms of xx and yy.

    Show answer

    d2ydx2=1+2xy+2y3\dfrac{d^2y}{dx^2} = 1 + 2xy + 2y^3

    Differentiate x+y2x + y^2 with respect to xx, remembering yy depends on xx: d2ydx2=1+2ydydx\dfrac{d^2y}{dx^2} = 1 + 2y\dfrac{dy}{dx}. Substituting dydx=x+y2\dfrac{dy}{dx} = x + y^2 gives 1+2y(x+y2)=1+2xy+2y31 + 2y(x + y^2) = 1 + 2xy + 2y^3.

Go deeper