🌌 Calculus Kingdom · Calculus

Higher-Order Derivatives

Differentiate again and again: second, third and nth derivatives of polynomials, exponentials, sines and reciprocals, the patterns they fall into, and what each order means.

In short

  • A higher derivative needs no new rule: differentiate, then differentiate the answer, one rung at a time. f'' measures the rate at which the rate is changing β€” acceleration on a position graph, curvature on any graph β€” and d2y/dx2 is a label for that, with nothing in it being squared.
  • Each derivative of a polynomial lowers its degree by 1, so a polynomial of degree n has fn equal to the constant n! times its leading coefficient, and order n + 1 is the first that is 0 for every x.
  • Sine and cosine repeat every 4 differentiations, and ekx never changes shape at all. In every case the chain rule pays a factor of k per rung, so the nth derivative of sin(kx) or ekx carries kn β€” a power, not a single k.
  • For any polynomial, fk(0) = k! times the coefficient of xk. Derivatives at a point and coefficients are the same information written two ways, which is the whole idea behind a Taylor series.

The derivative of a derivative

Every craft in the Derivative Spire so far has stopped after one differentiation. But f'(x) is a function, not a number β€” it has a value at every x, it has a graph, and there is no reason at all why it should not be differentiated in its turn.

Do that and you get the second derivative, written f''(x). Differentiate again for f'''(x), and again for the fourth. After three primes the notation gets unreadable, so the order moves into a bracket up top:

f(x), f'(x), f''(x), f'''(x), f4(x), f5(x), ...

The bracket matters: f4(x) is the fourth derivative, while f(x)4 would be the function raised to the fourth power. Two completely different things.

What does it measure? f'(x) answers "how fast is f changing". So f''(x) answers "how fast is that rate changing" β€” a rate of a rate. The everyday example is motion. Let s(t) be where something is at time t:

  • s'(t) is the velocity: how fast the position is changing.
  • s''(t) is the acceleration: how fast the velocity is changing.
  • s'''(t) is called the jerk: how fast the acceleration is changing, which is what you feel when a train's braking suddenly eases off.

A car cruising at a steady 100 km/h has a large velocity and zero acceleration. A car pulling away from rest has a small velocity and a large acceleration. The first derivative and the second derivative are genuinely independent pieces of information, and knowing one tells you nothing about the other.

The other notation. In Leibniz's notation the first derivative is dy/dx, so the second is d/dx applied to dy/dx, which is written

d2y/dx2

Read it as "d two y by d x squared", and read it as a label, not as a calculation. Nothing there is being squared. The 2 on top counts differentiations; the 2 on the bottom records that all of them were with respect to x. In the same way d3y/dx3 is the third derivative.

What the sign says. f'(x) > 0 means f is increasing. f''(x) > 0 means f' is increasing β€” the slope is getting steeper as you move right β€” and that is exactly what "the graph bends upwards", or concave up, means. So a second derivative is the algebraic name for curvature, which is why curve sketching leans on it so heavily. And be careful about what a second derivative does *not* say: f''(3) = -4 tells you the graph is concave down at x = 3. It says nothing whatever about f(3) or about f'(3).

The polynomial ladder, and where it runs out

Polynomials are the easiest place to see a ladder of derivatives, because each rung is one more use of the power rule and nothing else. Take f(x) = 2x4 - 5x3 + x - 9:

f'(x) = 8x3 - 15x2 + 1 f''(x) = 24x2 - 30x f'''(x) = 48x - 30 f4(x) = 48 f5(x) = 0

Two things happen on every rung. The degree drops by exactly 1, because every exponent falls by 1. And the constant term disappears, because a constant has no slope.

So the ladder of a polynomial always ends. A polynomial of degree n reaches a non-zero constant at rung n, and the very next derivative, order n + 1, is 0 for every x β€” and so is every derivative after it. In the example the degree is 4, f4 is the constant 48, and the first order that is 0 everywhere is the 5th. Notice the count: it is n + 1, not n, because the constant left standing at rung n is not itself 0.

The star of the pattern is xn. Differentiate x5 five times:

5x4, 20x3, 60x2, 120x, 120

The multipliers 5, 4, 3, 2 and 1 have all come down and been collected, and their product is 5! = 120. In general the nth derivative of xn is the constant n!, and the (n+1)th is 0. If there is a coefficient in front, it simply rides along: the 4th derivative of 3x4 is 3 times 4! = 72.

Two slips live here, and both are worth naming now. The first is bringing the exponent down as a multiplier but forgetting to lower it β€” x5 becomes 5x4, never 5x5. The second is stopping one rung early or going one too far. Count the primes against the order you were asked for, every time, and write each rung on its own line so the count is visible.

Fractions behave no differently. For f(x) = 3x5/4 the first rung is 15x4/4, the second is 15x3, and the third is 45x2 β€” a denominator that survives one rung can easily be cancelled by the next multiplier that comes down.

Ladders that never end: sin, cos, e^(kx) and 1/x

Some functions never run out of derivatives. They fall into patterns instead, and once you see the pattern you can jump straight to the 20th derivative without writing the first nineteen.

Sine and cosine run in a cycle of four.

sin(x) -> cos(x) -> -sin(x) -> -cos(x) -> sin(x) -> ...

Four differentiations bring you back to where you started, so only the remainder of the order on division by 4 matters. For sin(x), an order that leaves remainder 1 lands on cos(x), remainder 2 on -sin(x), remainder 3 on -cos(x) and remainder 0 back on sin(x). The 5th derivative of sin(x) is therefore cos(x), because 5 leaves remainder 1. Cosine runs the same loop, one place further round: cos -> -sin -> -cos -> sin.

Now put a k inside. For sin(kx) the chain rule pays a factor of k on every rung, so after n differentiations the answer carries kn:

d/dx sin(2x) = 2cos(2x) d2/dx2 sin(2x) = -4sin(2x) d3/dx3 sin(2x) = -8cos(2x) d5/dx5 sin(2x) = 32cos(2x)

The single most common error in the whole craft is writing cos(2x) or 2cos(2x) for that last one. It is kn, not k, and not 1.

The exponential is the simplest of all. ekx never changes shape; every derivative is a multiple of the same ekx, and each rung collects one more k. So the nth derivative of ekx is kn ekx: the 4th derivative of e3x is 81e3x, because 34 = 81. (Note that 34 is not the same as 4 times 3. The chain factors multiply together, so they build a power.)

And 1/x alternates. Write it as x-1 and let the power rule run:

f(x) = 1/x f'(x) = -1/x2 f''(x) = 2/x3 f'''(x) = -6/x4 f4(x) = 24/x5

The numerators 1, 2, 6, 24 are the factorials, the power underneath is always one more than the order, and the sign alternates because each new exponent that comes down is negative. In symbols the nth derivative of 1/x is (-1)n n! / xn+1. The same reading works for square roots: sqrt(x) = x1/2 gives exponents 1/2, -1/2, -3/2, -5/2 in turn, so f''(x) = -1/(4x3/2) and f''(4) = -1/32.

Second derivatives of products and compositions

There is no "second product rule" to learn. To find f''(x) for a product, use the product rule once, then use it again on whatever comes out. The only discipline needed is to differentiate the whole of f'(x), including the parts that are themselves products.

x ex. With u = x and v = ex:

f'(x) = (1)(ex) + (x)(ex) = (1 + x)ex f''(x) = (ex) + (ex + x ex) = (2 + x)ex

The ex term arrives twice on the second rung, once from each factor, which is where the 2 comes from. With ekx inside, every rung also pays its factor of k, and x ekx gives f''(x) = (2k + k2 x)ekx.

x sin(x). With u = x and v = sin(x):

f'(x) = sin(x) + x cos(x) f''(x) = cos(x) + (cos(x) - x sin(x)) = 2cos(x) - x sin(x)

Again a term lands on top of one already there, and the 2 is the evidence that the product rule was used properly on the second rung.

The mistake to name out loud. The second derivative of a product is not u''v + uv''. For x sin(x) that would give 0 - x sin(x) = -x sin(x), and the whole 2cos(x) would have vanished. Every term of f'(x) has to be differentiated, cross terms included.

Compositions are gentler, because the chain rule simply applies twice. For (ax + b)n:

f'(x) = na(ax + b)n-1 f''(x) = n(n-1)a2 (ax + b)n-2

Notice a2. Two differentiations means the inside derivative is collected twice, exactly as k2 appeared for ekx. So the second derivative of (3x + 5)4 is (4)(3)(9)(3x + 5)2 = 108(3x + 5)2.

The same move handles a root. For sqrt(ax + b) = (ax + b)1/2:

f'(x) = (a/2)(ax + b)-1/2 f''(x) = (a/2)(-1/2)(a)(ax + b)-3/2 = -a2/(4(ax + b)3/2)

The minus sign is not optional: it comes from the exponent -1/2 coming down, and it is why the graph of any square root is concave down everywhere it exists.

Derivatives at 0 are the coefficients in disguise

Here is a fact that looks like a curiosity and turns out to be one of the most important ideas in all of mathematics.

Take a polynomial and evaluate its derivatives at x = 0:

f(x) = 5 - 2x + 6x2 + 3x3 f(0) = 5 f'(x) = -2 + 12x + 9x2, so f'(0) = -2 f''(x) = 12 + 18x, so f''(0) = 12 f'''(x) = 18, so f'''(0) = 18

Look at the pairs. The constant term is f(0). The coefficient of x is f'(0). The coefficient of x2 is 6, and f''(0) = 12 = 2! times 6. The coefficient of x3 is 3, and f'''(0) = 18 = 3! times 3. The rule is

fk(0) = k! times (the coefficient of xk)

and the reason is exactly the ladder above. Differentiate k times: every term below xk has been flattened to 0, every term above xk still carries an x and so vanishes when 0 is substituted, and the xk term has collected the multipliers k, k-1, ..., 1 on its way down. Only one term can survive, and it arrives multiplied by k!.

It runs both ways. Given f(0) = 5, f'(0) = -2, f''(0) = 12 and f'''(0) = 18, you can rebuild the cubic: divide each value by the matching factorial to recover its coefficient, giving 5, -2, 12/2 = 6 and 18/6 = 3, so f(x) = 5 - 2x + 6x2 + 3x3. The coefficient need not be whole β€” if f'''(0) = 20, the coefficient of x3 is 20/6 = 10/3.

The trap in both directions is the factorial. A coefficient of 7 in the x4 place is not f4(0); f4(0) is 4! times 7 = 168. And dividing by k rather than by k! is a near miss that only shows up from k = 3 onwards, where 3! = 6 and 3 are finally different.

Why does this matter so much? Because it says that a polynomial's coefficients and its derivatives at a point carry exactly the same information. Know all the derivatives at 0 and you know the polynomial. That is the seed of the Taylor series, which does the same trick for functions like sin(x) and ex that have no last derivative at all β€” and it is why anyone bothers to compute a 5th or a 7th derivative in the first place.

Worked examples

Example 1

f(x) = 2x5 - 3x4 + x2 - 7. Find the third derivative f'''(x).

  1. Take the rungs one at a time and write each on its own line, so the count of derivatives stays visible.
  2. f'(x) = 10x4 - 12x3 + 2x. The constant -7 has disappeared, as every constant does.
  3. f''(x) = 40x3 - 36x2 + 2. Notice the 2x has become the constant 2, and it will disappear on the next rung.
  4. f'''(x) = 120x2 - 72x.
  5. Check the count: three primes, three differentiations, and the degree has fallen from 5 to 2 as it must.

Example 2

f(x) = sin(3x), with x in radians. Find the 5th derivative of f.

  1. Two things travel independently: which function you land on, and the number in front. Deal with them separately.
  2. The function part runs the cycle sin -> cos -> -sin -> -cos, which repeats every 4 steps. 5 leaves a remainder of 1 on division by 4, so 5 steps land in the same place as 1 step, which is cos(3x).
  3. The number in front comes from the chain rule: the inside 3x has derivative 3, and that factor is collected on every rung. After 5 rungs it is 35 = 243.
  4. Put the two together: the 5th derivative is 243cos(3x).
  5. Sanity check on the first rung: the derivative of sin(3x) is 3cos(3x), which matches the pattern with n = 1.

Example 3

f(x) = x2 e2x. Find f''(x).

  1. This is a product, so use the product rule once and then use it again on the result. There is no shortcut to memorise.
  2. First rung: u = x2 with u' = 2x, and v = e2x with v' = 2e2x. So f'(x) = 2x e2x + 2x2 e2x.
  3. Second rung: differentiate both terms, and each of them is itself a product. From 2x e2x comes 2e2x + 4x e2x; from 2x2 e2x comes 4x e2x + 4x2 e2x.
  4. Collect: f''(x) = 2e2x + 8x e2x + 4x2 e2x = (2 + 8x + 4x2)e2x.
  5. The middle coefficient is 8 rather than 4 because that term arrived twice, once from each of the two pieces of f'(x). Losing one copy of it is the classic slip here.

Practice problems, with solutions

Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.

Problem 1

Difficulty 1 of 5

f(x) = 3x3 + 2x2 - x + 4 Find the second derivative f''(x). Give your answer as an expression in x.

Answer: 18x + 4

  1. f'(x) = 9x2 + 4x - 1
  2. f''(x) = 18x + 4
  3. So f''(x) = 18x + 4.

Problem 2

Difficulty 3 of 5

f(x) = sqrt(x), for x > 0. Find f''(16). Give an exact answer, as a fraction in lowest terms if it is not a whole number.

Answer: -1/256

  1. Rewrite f as a power of x, then apply the power rule 2 times.
  2. f'(x) = 1/(2sqrt(x))
  3. f''(x) = -1/(4x3/2)
  4. Substitute x = 16.
  5. f''(16) = -1/256

Problem 3

Difficulty 4 of 5

f(x) = 2e3x + sin(x), with x in radians. Find the 5th derivative of f. Give your answer as an expression in x.

Answer: 486e3x + cos(x)

  1. Exponential term: each rung multiplies by 3, so after 5 of them it is 486e3x.
  2. Sine term: 5 steps round sin -> cos -> -sin -> -cos lands on cos(x).
  3. f5(x) = 486e3x + cos(x)

Common mistakes

  • Stopping one rung short, or taking one rung too many. f''(x) means exactly two differentiations; f4(x) means exactly four. Write each derivative on its own line and count the lines against the primes before handing the answer in.
  • Forgetting the chain factor after the first rung. The 3rd derivative of sin(2x) is -8cos(2x): each of the three differentiations paid a factor of 2, so the answer carries 23, not 2 and not 1. The same applies to every ekx.
  • Losing a sign in the sine and cosine cycle. sin -> cos -> -sin -> -cos is the order, and the minus signs appear on the third and fourth steps. Say the cycle out loud rather than guessing where the minus should land.
  • Differentiating a product piece by piece on the second rung. The second derivative of x sin(x) is 2cos(x) - x sin(x), not -x sin(x): every term of f'(x) must be differentiated, and the cross terms are real. If a whole term has disappeared, that is usually why.
  • Confusing a coefficient with a derivative at 0. If the x3 coefficient is 7 then f'''(0) is 3! times 7 = 42, and going the other way means dividing by 3! = 6, not by 3. The factorial is the whole content of the rule and it is the part most often dropped.

What you should be able to do

  • Find the second, third and fourth derivatives of a polynomial and evaluate them at a point.
  • Follow the cycle of sin and cos and the powers of ekx to a named higher derivative.
  • Find the second derivative of a product or a composition, and read f'' as acceleration and f''' as jerk.
  • Read the pattern of the nth derivative of 1/x and xn, and relate fk(0) to a coefficient.

Where this fits in the curriculum

Common Core

  • FUN-3.F

    AP Calculus AB, Unit 3 β€” Determine higher order derivatives of a function.

    The Common Core has no calculus standards; this is the AP Calculus AB learning objective.

Learn these first