Second and higher derivatives
The derivative is itself a function, so it has a slope of its own. What does the rate of change of a rate of change measure, and what happens when you keep differentiating?
Where you are 13 in Derivatives
Why this exists
The derivative as a function turned the slopes of f into a new function f'. Nothing stops us from doing it again. A speedometer reading is the derivative of position, but a driver pressing the gas pedal feels something else: how fast the speedometer reading itself is changing. That is the derivative of the derivative, and physics needs it, since a force produces acceleration, not velocity.
Day 1 defines the second derivative, its notation and its meaning as acceleration, reads it from a graph, and computes it with the product and quotient rules. Day 2 keeps differentiating and finds the patterns: powers end in a factorial and then zero, sine and cosine cycle, exponentials repeat, and \dfrac{1}{x} builds factorials with alternating signs.
Definition
Day 1: the derivative of the derivative
If f' is differentiable at x, the second derivative of f at x is the derivative of f' there:
For this to make sense, f' must exist on an open interval around x, not only at x. In Leibniz notation, applying \dfrac{d}{dx} twice is written
read “dee two y dee x squared”. The 2 sits on d in the top and on x in the bottom because the instruction \dfrac{d}{dx} is applied twice; it is a symbol, not a square of anything. Continuing, the third derivative is f''' = (f'')', and the nth derivative f^{(n)} is the derivative of f^{(n-1)}, also written \dfrac{d^ny}{dx^n}. From the fourth on, primes give way to the bracketed number: f^{(4)}, f^{(5)}. By convention f^{(0)} = f. The brackets matter: f^{(4)} is a derivative, f^4 is a power.
Units. A derivative carries units of output per unit of input, so a second derivative carries units of output per unit of input per unit of input. If s(t) is a position in meters at time t in seconds, the velocity is v(t) = s'(t) in meters per second, and the acceleration is
in meters per second per second, written \text{m/s}^2. An acceleration of 3\ \text{m/s}^2 means the velocity is growing at 3 meters per second, each second. The third derivative s'''(t), the rate of change of acceleration, is called jerk and is measured in \text{m/s}^3; it is what a passenger feels when a ride starts or stops abruptly.
Day 2: higher derivatives
Every rule from earlier lessons applies at each step, since each step is an ordinary derivative. What is new is that repeated differentiation of a familiar function usually falls into a pattern, and a pattern found and proved once gives every f^{(n)} at once. The patterns use the factorial, n! = 1 \cdot 2 \cdot 3 \cdots n for a positive integer n, with 0! = 1.
A function can have a first derivative everywhere and still have no second derivative at some point. The function x|x| is the example: it is differentiable at 0 (The derivative at a point asks for f'(0) in its exercises), but its derivative is 2|x|, which has a corner at 0 (proved below).
Intuition
f''(x) is to f' exactly what f'(x) is to f. So everything The derivative as a function said about reading slopes as heights applies one level up: the heights of f'' are the slopes of the graph of f'. Where f' rises, f'' > 0; where f' falls, f'' < 0; where f' has a level tangent, f'' = 0. Figure 1 shows one pair.
On the graph of f itself, f'' measures how fast the slope is changing as you move along. A straight line has constant slope, so its second derivative is 0. A graph whose slopes keep increasing bends upward, and one whose slopes keep decreasing bends downward; that bending is the subject of Concavity and inflection points.
For motion, the three graphs s, v, a tell one story at three levels. The velocity is the slope of the position graph, and the acceleration is the slope of the velocity graph (Figure 2, in Example 2).
Results
Repeated derivatives. For a positive integer n and every x:
for 0 \le k \le n, so the nth derivative of x^n is the constant n!, and every later derivative is 0. A polynomial p(x) = a_n x^n + \cdots + a_1 x + a_0 of degree n has p^{(n)}(x) = n!\,a_n and p^{(n+1)}(x) = 0.
Sine and cosine cycle every four steps (angles in radians):
so \dfrac{d^n}{dx^n}[\sin x] depends only on the remainder when n is divided by 4, and likewise for \cos x, which starts the same cycle one step later.
Exponentials. For every n, \dfrac{d^n}{dx^n}\big[e^x\big] = e^x, and for a > 0,
The reciprocal. For x \ne 0 and every positive integer n (proved in Example 7):
Why it is true
Powers. The power rule from The power rule and basic differentiation rules multiplies by the current exponent and lowers it by one. Starting from x^n, after one step the coefficient is n, after two n(n - 1), and after k steps
with exponent n - k. At k = n this is n!\,x^0 = n!, a constant, whose derivative is 0. For a polynomial of degree n, the sum and constant multiple rules let each term be differentiated on its own. The term a_k x^k with k < n has become 0 by step k + 1 \le n, so after n steps only a_n \cdot n! survives, and one more step gives 0.
Sine and cosine. From Derivatives of the trigonometric functions, (\sin x)' = \cos x and (\cos x)' = -\sin x, and by the constant multiple rule (-\sin x)' = -\cos x and (-\cos x)' = \sin x. Four steps return to \sin x, so writing n = 4q + r with r \in \{0, 1, 2, 3\}, the nth derivative equals the rth.
Exponentials. From Derivatives of exponential functions, (a^x)' = (\ln a)\,a^x. The factor \ln a is a constant, so the next derivative is \ln a times the derivative of a^x, which is (\ln a)^2 a^x; each step contributes one more factor \ln a. For a = e, \ln e = 1 and nothing changes.
A first derivative with no second derivative. Let f(x) = x|x|, which is x^2 for x \ge 0 and -x^2 for x < 0. For x > 0, f'(x) = 2x; for x < 0, f'(x) = -2x; at 0 the difference quotient is \dfrac{h|h| - 0}{h} = |h| \to 0, so f'(0) = 0. Together, f'(x) = 2|x| for every x. The quotient for f' at 0 is \dfrac{2|h|}{h}, which is 2 for h > 0 and -2 for h < 0, so f''(0) does not exist, while f''(x) = 2 for x > 0 and -2 for x < 0.
Worked examples
Day 1: reading f’’ from the graph of f’
The top of Figure 1 is the graph of f'. It has level tangents at (-2, 4) and (2, -4), and the dashed tangent at the origin passes through (1, -3). (a) Find the zeros and the sign of f''. (b) Find f''(0). (c) Sketch f'', then check against the formula behind the graph, f'(x) = \dfrac{x^3}{4} - 3x.
Solution(a) f'' is the slope of f'. The level tangents give f''(-2) = 0 and f''(2) = 0. Left of -2 the graph of f' rises, so f'' > 0; between -2 and 2 it falls, so f'' < 0; right of 2 it rises again, so f'' > 0.
(b) The tangent to f' at the origin runs through (0, 0) and (1, -3), so
(c) Between -2 and 2 the fall of f' is steepest at the origin, so f'' has its lowest value -3 there. Outside [-2, 2] the graph of f' gets steeper and steeper, so f'' grows without bound both ways: a U-shaped graph (Figure 1, bottom). From the formula, by the power rule,
an upward parabola with zeros \pm 2 and vertex (0, -3), as sketched.
Day 1: Matus’s quadcopter
Matus flies a quadcopter straight up. Its height after t seconds is h(t) = -t^3 + 6t^2 + 15t meters, for 0 \le t \le 5. (a) Find the velocity and acceleration functions. (b) Find both at t = 1 and t = 4, with units, and say what the accelerations mean. (c) When is the acceleration 0, and what is the velocity then?
Solution(a) Velocity is the first derivative of height and acceleration the second, both by the power rule:
(b) At t = 1: v(1) = -3 + 12 + 15 = 24 meters per second and a(1) = 6\ \text{m/s}^2. The quadcopter is climbing at 24 meters per second, and its upward velocity is increasing at about 6 meters per second each second. At t = 4: v(4) = -48 + 48 + 15 = 15 meters per second and a(4) = -12\ \text{m/s}^2. It is still climbing, but its upward velocity is now decreasing at 12 meters per second each second. A negative acceleration says the velocity is falling; here the quadcopter still rises, just more slowly.
(c) a(t) = 0 when t = 2, where v(2) = -12 + 24 + 15 = 27 meters per second. Before t = 2 the velocity rises (a > 0) and after it falls (a < 0), so 27 meters per second is the fastest climb (Figure 2). At t = 5, v(5) = -75 + 60 + 15 = 0: the quadcopter hovers at h(5) = 100 meters. What a sign of velocity and acceleration says about speeding up and slowing down is taken up in Position, velocity and acceleration.
Day 1: a second derivative through the product rule
Find f''(x) for f(x) = x^2 \cos x, and find f''(\pi).
SolutionBy the product rule,
Each term of f' is again a product, so the product rule is used twice more:
Subtracting the second from the first and collecting terms,
At x = \pi, \cos \pi = -1 and \sin \pi = 0, so
The middle term -4x\sin x collected two equal pieces, one from each product; exercise 21 shows why a factor 2 always appears there.
Day 1: a second derivative through the quotient rule
Find f''(x) for f(x) = \dfrac{x}{x^2 + 1}, and the inputs where f''(x) = 0.
SolutionBy the quotient rule,
For the next quotient we need the derivative of the denominator (x^2 + 1)^2. Expanding it to x^4 + 2x^2 + 1, its derivative is 4x^3 + 4x = 4x(x^2 + 1). The quotient rule then gives f''(x) as a fraction with denominator (x^2 + 1)^4 and numerator
Every term on top has the factor x^2 + 1; canceling one copy with the bottom,
The denominator is never 0, so f''(x) = 0 exactly when x = 0 or x^2 = 3: at x = 0, \displaystyle x = \sqrt{3} and \displaystyle x = -\sqrt{3}. Simplifying f' before differentiating again is what keeps the second step manageable.
Day 2: a power and a polynomial, all the way down
(a) List every derivative of x^6. (b) For p(x) = 3x^5 - 4x^2 + 1, find p^{(4)}, p^{(5)} and p^{(6)}, and compare p''(0) with the coefficient of x^2.
Solution(a) Each step multiplies by the exponent and lowers it by one:
The sixth derivative is 720 = 6!, and every derivative after it is 0.
(b) Differentiating term by term, p'(x) = 15x^4 - 8x, p''(x) = 60x^3 - 8, p'''(x) = 180x^2, and
As the Results predict, p^{(5)} = 5! \cdot 3 = 360 and p^{(6)} = 0; the terms -4x^2 and 1 died out after three steps and one step. Finally p''(0) = -8 = 2! \cdot (-4): the second derivative at 0 is 2! times the coefficient of x^2. In the same way p^{(k)}(0) = k!\,a_k for each k, so the derivatives at 0 recover every coefficient. That observation is the seed of Taylor polynomials.
Day 2: cycles and exponentials
Find (a) \dfrac{d^{50}}{dx^{50}}[\sin x]; (b) f^{(23)}(x) for f(x) = 2\sin x + 3\cos x; (c) g^{(n)}(x) for g(x) = 2^x, and g'''(0).
Solution(a) 50 = 4 \cdot 12 + 2, so the fiftieth derivative is the second: -\sin x.
(b) 23 = 4 \cdot 5 + 3, so take three steps. For sine: \cos x, -\sin x, -\cos x. For cosine: -\sin x, -\cos x, \sin x. By the constant multiple and sum rules,
(c) Each derivative brings one factor \ln 2: g^{(n)}(x) = (\ln 2)^n\, 2^x. So g'''(0) = (\ln 2)^3 \cdot 2^0 = (\ln 2)^3 \approx 0.333. Since \ln 2 < 1, the derivatives of 2^x at 0 shrink toward 0 as n grows, but none of them is ever 0: unlike a polynomial, an exponential never runs out of derivatives.
Day 2: the derivatives of 1/x
Find the first four derivatives of f(x) = \dfrac{1}{x}, guess a formula for f^{(n)}(x), prove it, and find f^{(6)}(2).
SolutionWrite f(x) = x^{-1} and use the power rule for negative exponents:
The signs alternate, starting negative, and the coefficients 1, 2, 6, 24 are 1!, 2!, 3!, 4!. The exponent of the nth derivative is -(n + 1). The guess:
The proof is by induction on n. For n = 1 the formula gives -1! \cdot x^{-2} = -x^{-2}, which is right. Suppose it holds for some n. Differentiating f^{(n)} by the power rule, the constant (-1)^n n! stays and x^{-(n+1)} becomes -(n + 1)x^{-(n+2)}:
which is the formula with n + 1 in place of n. So it holds for every positive integer n, for every x \ne 0. Then
Boundaries
- f''(a) needs f' on a whole interval around a. A first derivative at one point is not enough, and even a first derivative everywhere is not enough: x|x| has f'(x) = 2|x| for all x but no f''(0).
- Each f^{(n)} exists only where f^{(n-1)} is differentiable. |x|^3 has a first and a second derivative at 0 but no third (exercise 24).
- The patterns hold only where the function and its derivatives exist. The formula for \dfrac{1}{x} needs x \ne 0; the formula for a^x needs a > 0.
- The sine and cosine cycle needs radians. In degrees each derivative brings an extra factor \displaystyle \frac{\pi}{180}, as Derivatives of the trigonometric functions showed for the first derivative.
- Only polynomials reach 0. e^x, a^x with a \ne 1, \sin x and \dfrac{1}{x} have nonzero derivatives of every order.
- The sign of f'' alone says nothing about the sign of f'. A negative acceleration with a positive velocity is a climb that is slowing (Example 2 at t = 4).
Where this goes next
The sign of f'' decides which way a graph bends, the subject of Concavity and inflection points, and with velocity and acceleration together Position, velocity and acceleration describes when a moving object stops, turns or speeds up. Equations that tie a function to its own derivatives, such as y'' + y = 0, which sine and cosine satisfy by the cycle above, are checked in Differential equations and their solutions. The fact that derivatives at 0 recover a polynomial’s coefficients becomes Taylor polynomials, and the endless repetition of e^x gives The common Maclaurin series. Second derivatives also appear in Implicit differentiation and Derivatives of parametric curves.
Exercises
Day 1: computing second derivatives
- For f(x) = 4x^3 - 5x^2 + x - 9, find f''(x), f''(-1) and f'''(x).
- For \displaystyle y = 6\sqrt{x} with x > 0, find \dfrac{d^2y}{dx^2} and its value at x = 4.
- For y = 2x^5 - \dfrac{1}{x}, find \dfrac{d^2y}{dx^2} and its value at x = 1.
Day 1: acceleration
- Lubos pushes a cart along a straight track. Its position is s(t) = 2t^3 - 9t^2 + 12t meters after t seconds. Find v(3) and a(3) with units, and the time when the acceleration is 0.
- A ball is thrown upward; its height is h(t) = 1.5 + 14t - 4.9t^2 meters after t seconds. Find its acceleration at every time, and explain what the number means for the velocity.
- Zuzka’s bike has velocity v(t) = 5 + 0.9t - 0.05t^2 meters per second for 0 \le t \le 20. Find a(5) and a(15) with units, and the time when the acceleration is 0.
Day 1: reading f’’ from a graph
- Figure 3 is the graph of f'. Find f''(x) on each open piece, and say where f'' does not exist.
- For f(x) = \sin x the graph of f' is the graph of \cos x. Read f''(0), \displaystyle f''\big(\frac{\pi}{2}\big) and f''(\pi) as slopes of the cosine graph, then confirm with a formula for f''.
Day 1: products and quotients
- For y = (x^2 - 2)e^x, find y'' in factored form and y''(-1).
- For y = \tan x, find y'' by writing \sec^2 x = \sec x \cdot \sec x, and find \displaystyle y''\big(\frac{\pi}{4}\big).
- For g(x) = \dfrac{x}{x + 1}, find g''(x) and g''(1).
- For k(x) = \dfrac{e^x}{x}, find k''(x) and k''(1).
Day 2: powers and polynomials
- For f(x) = x^8, find f'''(x), f^{(8)}(x) and f^{(9)}(x).
- For p(x) = 2x^4 - x^3 + 5x - 7, find every derivative through p^{(5)}.
- Find the polynomial p of degree 3 with p(0) = 1, p'(0) = 2, p''(0) = 6 and p'''(0) = 12.
Day 2: cycles, exponentials and reciprocals
- Find \dfrac{d^{99}}{dx^{99}}[\cos x].
- For f(x) = \sin x - \cos x, find f^{(42)}(0).
- For g(x) = 5^x, find g^{(n)}(x) and g^{(4)}(0) to two decimal places.
- Write e^{2x} as \big(e^2\big)^x and use the pattern for a^x to find \dfrac{d^n}{dx^n}\big[e^{2x}\big] and its value at x = 0 for n = 5. (The chain rule gives the same result.)
- For f(x) = \dfrac{1}{x}, find f^{(5)}(-1).
Reasoning
- Prove that (fg)'' = f''g + 2f'g' + fg'' for twice differentiable f and g. Use it to find the second derivative of xe^x.
- Prove by induction that for f(x) = \dfrac{1}{x^2}, f^{(n)}(x) = \dfrac{(-1)^n (n + 1)!}{x^{n + 2}} for every positive integer n.
- Matus says that if f'(3) = 0, then f''(3) = 0 as well. Is he right? Explain using the graph of f'.
- Show that g(x) = |x|^3 has a first and a second derivative at 0 but no third derivative there.
Answers
- f''(x) = 24x - 10, f''(-1) = -34, f'''(x) = 24. From f'(x) = 12x^2 - 10x + 1.
- \dfrac{d^2y}{dx^2} = -\dfrac{3}{2}x^{-3/2}, which is -\dfrac{3}{16} at x = 4. Write y = 6x^{1/2}; then y' = 3x^{-1/2}, and \displaystyle -\frac{3}{2} \cdot 4^{-3/2} = -\frac{3}{2} \cdot \frac{1}{8}.
- \dfrac{d^2y}{dx^2} = 40x^3 - \dfrac{2}{x^3}, which is 38 at x = 1. From y' = 10x^4 + x^{-2} and y'' = 40x^3 - 2x^{-3}.
- v(3) = 12 meters per second, a(3) = 18\ \text{m/s}^2, and a = 0 at t = 1.5 seconds. v(t) = 6t^2 - 18t + 12 and a(t) = 12t - 18.
- a(t) = -9.8\ \text{m/s}^2 for every t. v(t) = 14 - 9.8t, whose derivative is the constant -9.8: the upward velocity drops by 9.8 meters per second every second, on the way up and on the way down alike. This is the pull of gravity.
- a(5) = 0.4\ \text{m/s}^2, a(15) = -0.6\ \text{m/s}^2, and a = 0 at t = 9 seconds. a(t) = v'(t) = 0.9 - 0.1t.
- f''(x) = 2 on (0, 2), 0 on (2, 5), and -1.5 on (5, 7). These are the slopes \displaystyle \frac{2 - (-2)}{2 - 0}, \displaystyle \frac{2 - 2}{5 - 2} and \displaystyle \frac{-1 - 2}{7 - 5}. f'' does not exist at the corners x = 2 and x = 5.
- f''(0) = 0, \displaystyle f''\big(\frac{\pi}{2}\big) = -1, f''(\pi) = 0. The cosine graph is level at its peak x = 0 and at its trough x = \pi, and falls most steeply at \displaystyle \frac{\pi}{2}, with slope -1. Confirmed by f''(x) = -\sin x.
- y'' = x(x + 4)e^x and y''(-1) = -\dfrac{3}{e}. By the product rule y' = 2xe^x + (x^2 - 2)e^x, which is (x^2 + 2x - 2)e^x. Again, y'' is (2x + 2)e^x + (x^2 + 2x - 2)e^x, which is (x^2 + 4x)e^x. At x = -1: (-1)(3)e^{-1}.
- y'' = 2\sec^2 x \tan x and \displaystyle y''\big(\frac{\pi}{4}\big) = 4. y' = \sec x \cdot \sec x; the product rule with (\sec x)' = \sec x\tan x gives 2\sec x \cdot \sec x \tan x. At \displaystyle \frac{\pi}{4}, \sec^2 x = 2 and \tan x = 1.
- g''(x) = -\dfrac{2}{(x + 1)^3} and g''(1) = -\dfrac{1}{4}. First g'(x) = \dfrac{(x + 1) - x}{(x + 1)^2}, which is \dfrac{1}{x^2 + 2x + 1}; then g''(x) = -\dfrac{2x + 2}{(x + 1)^4}, which simplifies.
- k''(x) = \dfrac{e^x(x^2 - 2x + 2)}{x^3} and k''(1) = e. First k'(x) = \dfrac{e^x(x - 1)}{x^2}. The quotient rule again has numerator x e^x \cdot x^2 - e^x(x - 1) \cdot 2x, which is xe^x(x^2 - 2x + 2), over x^4.
- f'''(x) = 336x^5, f^{(8)}(x) = 40{,}320, f^{(9)}(x) = 0. 8 \cdot 7 \cdot 6 = 336 and 8! = 40{,}320.
- p'(x) = 8x^3 - 3x^2 + 5, p''(x) = 24x^2 - 6x, p'''(x) = 48x - 6, p^{(4)}(x) = 48, p^{(5)}(x) = 0. Check: p^{(4)} = 4! \cdot 2 = 48.
- p(x) = 2x^3 + 3x^2 + 2x + 1. With p(x) = a_0 + a_1x + a_2x^2 + a_3x^3, p^{(k)}(0) = k!\,a_k, so a_0 = 1, a_1 = 2, \displaystyle a_2 = \frac{6}{2} = 3, \displaystyle a_3 = \frac{12}{6} = 2.
- \sin x. 99 = 4 \cdot 24 + 3, and three steps from cosine give -\sin x, -\cos x, \sin x.
- f^{(42)}(0) = 1. 42 = 4 \cdot 10 + 2, so f^{(42)} = f'' = -\sin x + \cos x, which is 1 at 0.
- g^{(n)}(x) = (\ln 5)^n\, 5^x and g^{(4)}(0) = (\ln 5)^4 \approx 6.71. Each derivative brings one factor \ln 5 \approx 1.609.
- \dfrac{d^n}{dx^n}\big[e^{2x}\big] = 2^n e^{2x}, and 32 at x = 0 for n = 5. With a = e^2, \ln a = 2, so (\ln a)^n a^x = 2^n e^{2x}.
- f^{(5)}(-1) = -120. From the formula, \dfrac{(-1)^5 \cdot 120}{(-1)^6} = -120.
- By the product rule (fg)' = f'g + fg'. Differentiate each product again: (f'g)' = f''g + f'g' and (fg')' = f'g' + fg''. Adding, (fg)'' = f''g + 2f'g' + fg''. For xe^x the three terms are 0, 2e^x and xe^x, so the second derivative is 2e^x + xe^x = (x + 2)e^x.
- For n = 1: f'(x) = -2x^{-3}, and the formula gives \displaystyle \frac{(-1)\cdot 2!}{x^3}, the same. If f^{(n)}(x) = (-1)^n (n + 1)!\,x^{-(n+2)}, the power rule multiplies by -(n + 2) and lowers the exponent, so f^{(n+1)}(x) is (-1)^{n+1}(n + 2)!\,x^{-(n+3)}, the formula for n + 1.
- No. f'(3) = 0 says the graph of f' has height 0 at 3; f''(3) is the slope of that graph there, and a graph can cross the axis with any slope. For f(x) = (x - 3)^2, f'(x) = 2(x - 3) is 0 at 3, but f''(3) = 2.
- g(x) = x^3 for x \ge 0 and -x^3 for x < 0. Away from 0, g'(x) = 3x^2 or -3x^2; at 0 the quotient \displaystyle \frac{|h|^3}{h} = h|h| \to 0. So g'(x) = 3x|x| everywhere. Likewise g''(x) = 6x or -6x away from 0, and at 0 the quotient \displaystyle \frac{3h|h|}{h} = 3|h| \to 0, so g''(x) = 6|x|. The quotient \displaystyle \frac{6|h|}{h} is 6 for h > 0 and -6 for h < 0, so g'''(0) does not exist.