Higher-order derivatives

A red racecar blurred as it speeds along a track
Photo by Jonathan Borba on Pexels.

A derivative describes how a quantity changes, but there is no reason that rate must remain constant. It may increase, decrease, or change direction; consequently, we may want to measure how the derivative itself is changing.

Taking another derivative produces a second derivative. Depending on the context, it might describe acceleration, changing sensitivity, or diminishing returns; graphically, it tells us how the slope of a curve varies. We can continue the process whenever a higher level of change carries useful information.

By the end of this lesson, you should be able to:

  • Compute second and higher-order derivatives and express them using prime and differential notation.
  • Interpret a second derivative as the rate of change of the first derivative, including its sign and units.
  • Use second derivatives to analyze acceleration, speeding up and slowing down, and diminishing returns.

Consider a racecar accelerating from rest along a straight track. During the first \( 10 \) seconds, its position \( s \), measured in meters from the starting line, is modeled by the function

\[s(t)=2t^2\text{,}\]

where \( t \) is the number of seconds since the car began moving.

We can use this function to find the position at various times.

\( t \) (seconds) \( s(t) \) (meters)
\( 0 \)
\( 2 \)
\( 4 \)
\( 6 \)
\( 8 \)
\( 10 \)

From \( t=0 \) to \( t=2 \), the car travels \( 8 \) meters. From \( t=2 \) to \( t=4 \), it travels meters. Over the successive two-second intervals, the distances traveled are .

Notice that the car's position is changing, but the rate at which its position changes is not staying constant.

To find the velocity of the car at any time \( t \), we can differentiate \( s(t)=2t^2 \):

\(\displaystyle v(t)=s'(t)=\)\(\displaystyle \text{.}\)

Since position is measured in meters and time is measured in seconds, \( v(t) \) is measured in .

Now let's take a look at the velocity at various times:

\( t \) (seconds) \( v(t) \) (meters per second)
\( 0 \)
\( 2 \)
\( 4 \)
\( 6 \)
\( 8 \)
\( 10 \)

Every two seconds, the car's velocity increases by meters per second. Therefore, the velocity is increasing at a rate of

\(\displaystyle \frac{8\text{ meters per second}}{2\text{ seconds}}=\)\(\displaystyle \text{.}\)

The units of this new rate are .

The usual abbreviation for “meters per second per second” is \( \displaystyle \frac{\mathrm{m}/\mathrm{s}}{\mathrm{s}}=\frac{\mathrm{m}}{\mathrm{s}^2}\text{.} \) The car is gaining \( 4 \) meters per second of velocity during every second, so its acceleration is \( 4\ \mathrm{m}/\mathrm{s}^2 \).

Notice that we found this new rate by taking the of the velocity function:

\(\displaystyle v'(t)=\dv{}{t}(4t)=\)\(\displaystyle \text{.}\)

But velocity was already the derivative of position, so we have taken the derivative of a derivative:

\[v'(t)=\dv{}{t}\bigl(s'(t)\bigr)\text{.}\]

We'll call this the second derivative of \( s(t) \), and we'll denote it with the notation \( s''(t) \). In general, whenever a rate of change is itself changing, the second derivative describes that change. In this situation, the second derivative measures the acceleration: the rate at which velocity is changing.

The second derivative

If \( f \) is a function, then its \( f' \) is another function, one whose outputs tell us the rate of change of \( f \). However, in many cases, this rate of change may itself also be changing. To see how, as you might expect, we can take the derivative of the derivative.

Because \( f'' \) is the of \( f' \), its sign at some value \( x=a \) tells us how \( f'(x) \) is changing at \( x=a \):

  • If \( f''(a)>0 \), then \( f' \) is increasing at \( x=a \).

  • If \( f''(a)<0 \), then \( f' \) is decreasing at \( x=a \).

  • If \( f''(a)=0 \), then \( f' \) has an instantaneous rate of change of \( 0 \) at \( x=a \).

When a variable \( y \) depends on \( x \), its second derivative can also be written in differential notation:

\[\dv[2]{y}{x}=\dv{x}\left(\dv{y}{x}\right)\text{.}\]

Velocity and acceleration

Let \( s(t) \) be an object's position at time \( t \) as it moves in a straight line. Its first derivative is its , \( v(t)=s'(t) \). We can then differentiate velocity to measure how it changes.

If position is measured in meters and time in seconds, velocity is measured in meters per second. Acceleration measures the change in that velocity per second, so its units are \[\frac{\text{meters per second}}{\text{second}}=\frac{\mathrm{m}}{\mathrm{s}^2}\text{,}\] read aloud as "meters per second squared."

Recall that the sign of velocity tells us the direction of motion: a positive velocity points in the positive direction (usually up or right), while a negative velocity points in the negative direction (usually down or left). Acceleration also has a direction, indicated by its sign.

At a particular instant, we can decide whether an object is speeding up or slowing down by comparing the directions of its velocity and acceleration:

  • When velocity and acceleration have the same sign, they point in the same direction. The acceleration reinforces the motion, so the magnitude of the velocity — the speed — increases.

  • When velocity and acceleration have opposite signs, the acceleration points against the motion, so the magnitude of the velocity decreases, and the object slows down.

This means a negative acceleration does not necessarily mean an object is slowing down: if its velocity is also negative, the acceleration is working with the velocity.

Velocity and acceleration What happens to speed?
Same sign: acceleration works with the velocity Speeding up
Opposite signs: acceleration works against the velocity Slowing down

Diminishing returns

In economics, diminishing returns occur when increasing an input (such as number of units produced) continues to produce gains (such as profit), but each additional increase produces a smaller gain (called a return) than before. If a function \( f \) measures the return, this typically means that \( f'(x)>0 \) while \( f''(x)<0 \): the return is increasing, but its rate of increase is decreasing.

The rate \( P'(x) \) estimates the profit gained from one additional device. Economists call this rate marginal profit, and give similar names to the rates for revenue and cost.

In our device model, \( MR(x)=50-0.02x \) and \( MC(x)=10 \). Their difference is \( MP(x)=40-0.02x \), the marginal profit we just interpreted. Near a production level of \( 1000 \) devices, one more device brings in about \( \$30 \) of revenue and adds \( \$10 \) of cost, leaving about \( \$20 \) of additional profit.

Higher-order derivatives

There's no reason to stop at the second derivative: to see how a given rate changes, we can often differentiate it again. The derivative of \( f'' \) is the third derivative, written \( f''' \). Differentiating once more gives the fourth derivative, written \( f'''' \), and so on. We call the number of derivatives that we've taken the order of the derivative.

Prime notation quickly becomes difficult to read, so for derivatives of arbitrary order we use a number in parentheses:

\[f^{(1)}(x)=f'(x),\qquad f^{(2)}(x)=f''(x),\qquad f^{(3)}(x)=f'''(x),\qquad \ldots,\qquad f^{(n)}(x)\text{.}\]

In differential notation, the same derivatives are written

\[\dv{y}{x},\qquad \dv[2]{y}{x},\qquad \dv[3]{y}{x},\qquad \ldots,\qquad \dv[n]{y}{x}\text{.}\]

Each new derivative measures the rate of change of the derivative before it. Using square brackets to denote units, if \( y=f(x) \), then

\[[f']=\frac{[y]}{[x]},\qquad [f'']=\frac{[y]}{[x]^2},\qquad [f^{(n)}]=\frac{[y]}{[x]^n}\text{.}\]

  1. Find the second derivative of each function.

    1. \( \displaystyle f(x)=${f} \)

      \( f''(x)= \)

      Solution

      Differentiate twice:

      \[\begin{aligned} f'(x)&=${fp}\\ f''(x)&=${fpp}\text{.} \end{aligned}\]

    2. \( \displaystyle g(x)=(x^2+${g_c})^{${g_n}} \)

      \( g''(x)= \)

      Solution

      The Chain Rule gives \( g'(x)=${2*g_n}x(x^2+${g_c})^{${g_n-1}} \). Differentiate this result using the Product Rule and Chain Rule:

      \[\begin{aligned} g''(x)&=${2*g_n}(x^2+${g_c})^{${g_n-1}}+${4*g_n*(g_n-1)}x^2(x^2+${g_c})^{${g_n-2}}\\ &=${2*g_n}(x^2+${g_c})^{${g_n-2}}\bigl(${2*g_n-1}x^2+${g_c}\bigr)\text{.} \end{aligned}\]

    3. \( \displaystyle h(x)=(${inner})^{${h_n}} \)

      \( h''(x)= \)

      Solution

      Apply the Chain Rule at each stage:

      \[\begin{aligned} h'(x)&=${h_n*h_a}(${inner})^{${h_n-1}}\\ h''(x)&=${h_n*(h_n-1)*h_a^2}(${inner})^{${h_n-2}}\text{.} \end{aligned}\]

  2. Consider the function

    \[f(x)=${f}\text{.}\]

    Use its first two derivatives to distinguish what is happening to \( f \) from what is happening to \( f' \) at several inputs.

    1. Find \( f'(x) \) and \( f''(x) \).

      \( f'(x)= \)

      \( f''(x)= \)

      Solution

      Differentiating the function and then its derivative gives

      \[\begin{aligned} f'(x)&=${fp}\\ f''(x)&=${fpp}\text{.} \end{aligned}\]

    2. Evaluate the derivatives at \( x=${x_left} \).

      \( f'(${x_left})= \) and \( f''(${x_left})= \).

      Which statement correctly interprets both signs?

      Choose one
      Solution

      Since \( f'(${x_left})=${fp_left}>0 \), the function \( f \) is increasing at \( x=${x_left} \). Since \( f''(${x_left})=${fpp_left}<0 \), the derivative \( f' \) is decreasing there. The signs describe two different functions.

    3. Evaluate the derivatives at \( x=${x_middle} \).

      \( f'(${x_middle})= \) and \( f''(${x_middle})= \).

      Which statement correctly interprets both values?

      Choose one
      Solution

      The positive value \( f'(${x_middle})=${fp_middle} \) tells us that \( f \) is increasing at \( x=${x_middle} \). The value \( f''(${x_middle})=0 \) tells us that the instantaneous rate of change of \( f' \) is \( 0 \) there.

    4. Evaluate the derivatives at \( x=${x_right} \).

      \( f'(${x_right})= \) and \( f''(${x_right})= \).

      Which statement correctly interprets both signs?

      Choose one
      Solution

      Here \( f'(${x_right})=${fp_right}>0 \), so \( f \) is increasing at \( x=${x_right} \). Also, \( f''(${x_right})=${fpp_right}>0 \), so \( f' \) is increasing there.

  3. An object's position along a straight line is modeled by

    \[s(t)=${s}\qquad (0\le t\le ${2*m})\text{,}\]

    where \( s \) is measured in meters and \( t \) in seconds.

    1. Find the object's velocity and acceleration functions.

      \( v(t)= \)

      \( a(t)= \)

      Solution

      Velocity is the first derivative of position, and acceleration is the derivative of velocity:

      \[\begin{aligned} v(t)=s'(t)&=${v}\\ a(t)=v'(t)=s''(t)&=${acc}\text{.} \end{aligned}\]

      Velocity is measured in meters per second, and acceleration is measured in meters per second squared.

    2. At \( t=${t1} \), is the object speeding up or slowing down?

      Choose one
      Solution

      At \( t=${t1} \),

      \[v(${t1})=${v_outer}>0\qquad\text{and}\qquad a(${t1})=${a1}<0\text{.}\]

      The signs are opposite, so the object is slowing down.

    3. At \( t=${t2} \), is the object speeding up or slowing down?

      Choose one
      Solution

      At \( t=${t2} \),

      \[v(${t2})=${v_inner}<0\qquad\text{and}\qquad a(${t2})=${a2}<0\text{.}\]

      Both values are negative, so the object is speeding up while moving in the negative direction.

    4. At \( t=${t3} \), is the object speeding up or slowing down?

      Choose one
      Solution

      At \( t=${t3} \),

      \[v(${t3})=${v_inner}<0\qquad\text{and}\qquad a(${t3})=${a3}>0\text{.}\]

      The signs are opposite, so the object is slowing down while moving in the negative direction.

    5. At \( t=${t4} \), is the object speeding up or slowing down?

      Choose one
      Solution

      At \( t=${t4} \),

      \[v(${t4})=${v_outer}>0\qquad\text{and}\qquad a(${t4})=${a4}>0\text{.}\]

      Both values are positive, so the object is speeding up while moving in the positive direction.

  4. A company produces and sells \( x \) components each month. For \( 0\le x\le ${x2} \), its monthly revenue and cost, in dollars, are modeled by

    \[R(x)=${revenue_linear}x-${revenue_quadratic_text}x^2\qquad\text{and}\qquad C(x)=${cost_fixed}+${cost_linear}x+${cost_quadratic_text}x^2\text{.}\]

    1. Find the profit function \( P(x) \).

      \( P(x)= \)

      Solution

      Profit is revenue minus cost:

      \[\begin{aligned} P(x)&=R(x)-C(x)\\ &=(${revenue_linear}x-${revenue_quadratic_text}x^2)-(${cost_fixed}+${cost_linear}x+${cost_quadratic_text}x^2)\\ &=-${profit_quadratic_text}x^2+${profit_linear}x-${cost_fixed}\text{.} \end{aligned}\]

    2. Find the marginal profit \( MP(x)=P'(x) \) and the second derivative \( P''(x) \).

      \( MP(x)= \)

      \( P''(x)= \)

      Solution

      Differentiate the profit function twice:

      \[\begin{aligned} MP(x)=P'(x)&=${profit_linear}-${decay_text}x\\ P''(x)&=-${decay_text}\text{.} \end{aligned}\]

      Marginal profit is measured in dollars per component, and \( P''(x) \) is measured in dollars per component per component.

    3. Compare marginal profit at production levels of \( ${x1} \) and \( ${x2} \) components.

      \( MP(${x1})= \) and \( MP(${x2})= \).

      Solution

      Substitution gives

      \[\begin{aligned} MP(${x1})&=${profit_linear}-${decay_text}(${x1})=${mp1}\\ MP(${x2})&=${profit_linear}-${decay_text}(${x2})=${mp2}\text{.} \end{aligned}\]

      Near \( ${x1} \) components, one additional component increases predicted profit by approximately \( \$${mp1} \). Near \( ${x2} \) components, one additional component increases predicted profit by approximately \( \$${mp2} \).

    4. Which statement best explains how the model exhibits diminishing returns?

      Choose one
      Solution

      Both marginal-profit values are positive, so profit is increasing at both production levels. However, the marginal profit has fallen from approximately \( \$${mp1} \) per additional component to approximately \( \$${mp2} \) per additional component. The negative second derivative tells us that this marginal gain is decreasing, which is the pattern of diminishing returns.

  5. Let

    \[q(t)=${q}\text{.}\]

    1. Find \( q'''(t) \), \( q^{(4)}(t) \), and \( q^{(5)}(t) \).

      \( q'''(t)= \)

      \( q^{(4)}(t)= \)

      \( q^{(5)}(t)= \)

      Solution

      Differentiate the result from each line to obtain the next derivative:

      \[\begin{aligned} q'(t)&=${qp}\\ q''(t)&=${qpp}\\ q'''(t)&=${qppp}\\ q^{(4)}(t)&=${q4}\\ q^{(5)}(t)&=0\text{.} \end{aligned}\]

    2. Suppose \( q \) is measured in liters and \( t \) is measured in minutes. What are the units of \( q'''(t) \)?

      Choose one
      Solution

      Each derivative contributes another factor of minutes to the denominator. Therefore,

      \[[q''']=\frac{[q]}{[t]^3}=\frac{\text{liters}}{\text{minutes}^3}\text{.}\]

    3. Why is \( q^{(5)}(t)=0 \)?

      Choose one
      Solution

      Differentiating a polynomial lowers the degree by one until a constant remains. One more derivative gives zero. Since \( q \) has degree \( 4 \), its fourth derivative is constant and its fifth derivative is zero.

  6. Inflation

    The price \( P(t) \) of a basket of goods was recorded in four consecutive years:

    Year \( t \) \( 0 \) \( 1 \) \( 2 \) \( 3 \)
    Price \( P(t) \) \( \$100 \) \( \$101 \) \( \$105 \) \( \$111 \)
    1. Estimate \( P'(t) \) in years \( 0 \), \( 1 \), and \( 2 \) using the average rate of change from each year to the next.

      Solution

      Each pair of consecutive observations is one year apart, so the average rates of change are

      \[\begin{aligned} P'(0)&\approx\frac{P(1)-P(0)}{1-0}=\frac{101-100}{1}=1,\\ P'(1)&\approx\frac{P(2)-P(1)}{2-1}=\frac{105-101}{1}=4,\\ P'(2)&\approx\frac{P(3)-P(2)}{3-2}=\frac{111-105}{1}=6\text{.} \end{aligned}\]

      Thus, the price was increasing at estimated rates of \( \$1 \), \( \$4 \), and \( \$6 \) per year. These are estimates from year-long intervals, not exact instantaneous rates.

    2. Let \( I(t) \) denote the annual inflation rate. Calculate the percentage by which the price increased each year, rounding to two decimal places.

      Solution

      The percentage increase is the change in price divided by the price at the beginning of the year:

      \[\begin{aligned} I(0)&\approx\frac{101-100}{100}(100\%)=1.00\%,\\ I(1)&\approx\frac{105-101}{101}(100\%)\approx3.96\%,\\ I(2)&\approx\frac{111-105}{105}(100\%)\approx5.71\%\text{.} \end{aligned}\]

      The estimated annual inflation rate increased in each of the three years.

    3. What seems to be true about \( I'(t) \) over these years?

      Solution

      The inflation estimates rise from \( 1.00\% \) to \( 3.96\% \) to \( 5.71\% \), so \( I'(t) \) appears to be positive. Using consecutive differences, the estimated increases are approximately \( 2.96 \) percentage points and \( 1.75 \) percentage points per year.

    4. What seems to be true about \( I''(t) \) over these years?

      Solution

      The inflation rate is increasing, but its estimated increase falls from \( 2.96 \) percentage points to \( 1.75 \) percentage points. Therefore, \( I'(t) \) appears to be decreasing, so \( I''(t) \) appears to be negative. The available data give only a rough discrete estimate, rather than enough information to establish the sign at every instant.

    5. An article in the October 1996 issue of Notices of the American Mathematical Society, titled “Mathematics is an Edifice, not a Toolbox,” begins with the following observation:

      “In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president has used the third derivative to advance his case for reelection.”

      Make sense of this statement.

      Solution

      The price level is the original quantity. Inflation describes how rapidly prices are rising, so it is associated with a first derivative. The rate of increase of inflation is associated with a second derivative, and saying that this rate is decreasing refers to a negative third derivative.

      In this shorthand interpretation, prices may still be rising and inflation may still be increasing; the increase in inflation is itself becoming smaller. Because an inflation rate is actually a relative rate of change, the exact relationship is more involved, as the next task shows.

    6. For a price model with \( P(t)>0 \), let \( \displaystyle I(t)=\frac{P'(t)}{P(t)} \). Find a formula for \( I''(t) \) in terms of \( P(t) \) and its derivatives.

      Solution

      First differentiate \( I(t)=P'(t)P(t)^{-1} \) using the Product Rule:

      \[I'(t)=\frac{P''(t)}{P(t)}-\frac{(P'(t))^2}{(P(t))^2}\text{.}\]

      Differentiating each term once more gives

      \[\begin{aligned} I''(t) &=\frac{P'''(t)}{P(t)}-\frac{P''(t)P'(t)}{(P(t))^2} -2\frac{P'(t)P''(t)}{(P(t))^2} +2\frac{(P'(t))^3}{(P(t))^3}\\ &=\frac{P'''(t)}{P(t)}-3\frac{P'(t)P''(t)}{(P(t))^2} +2\frac{(P'(t))^3}{(P(t))^3}\text{.} \end{aligned}\]

      The third derivative \( P'''(t) \) appears, but it is only one part of \( I''(t) \). The exact measure also depends on the price level and its first two derivatives.

  7. Suppose \( y=x^3 \) and \( x=t^2 \).

    1. Substituting \( x=t^2 \) into \( y=x^3 \) gives \( y=t^6 \). Differentiating twice with respect to \( t \) gives

      \( \dv[2]{y}{t}= \).

      Solution

      After making the substitution first,

      \[\begin{aligned} y&=t^6\\ \dv{y}{t}&=6t^5\\ \dv[2]{y}{t}&=30t^4\text{.} \end{aligned}\]

    2. If the second-derivative notation behaved like an ordinary fraction, we might expect that

      \[\dv[2]{y}{t}=\dv[2]{y}{x}\left(\dv{x}{t}\right)^2\text{.}\]

      For the functions above, the right-hand side would be

      \( \dv[2]{y}{x}\left(\dv{x}{t}\right)^2= \).

      Solution

      Since \( \dv[2]{y}{x}=6x=6t^2 \) and \( \dv{x}{t}=2t \),

      \[\dv[2]{y}{x}\left(\dv{x}{t}\right)^2=6t^2(2t)^2=24t^4\text{.}\]

      This does not match the value \( 30t^4 \) found by differentiating \( y=t^6 \) directly.

    3. The second-order Chain Rule contains an additional term:

      \[\dv[2]{y}{t}=\dv[2]{y}{x}\left(\dv{x}{t}\right)^2+\dv{y}{x}\dv[2]{x}{t}\text{.}\]

      For the functions above, the additional term is

      \( \dv{y}{x}\dv[2]{x}{t}= \).

      Solution

      Here \( \dv{y}{x}=3x^2=3t^4 \) and \( \dv[2]{x}{t}=2 \), so the additional term is

      \[\dv{y}{x}\dv[2]{x}{t}=3t^4(2)=6t^4\text{.}\]

      Including it gives \( 24t^4+6t^4=30t^4 \), matching the direct calculation. This second-order Chain Rule is a special case of Faà di Bruno's formula. Thus, although \( \dv[2]{y}{x} \) is useful notation, its pieces cannot always be rearranged as ordinary algebraic factors when the independent variable changes.

    Exercise adapted from Jonathan Bartlett and Asatur Zh. Khurshudyan, Extending the Algebraic Manipulability of Differentials.