Unit 3 · Topic 3.6

Differentiate repeatedly

Builds on the derivative rules of Unit 2 and the chain rule. 12 minutes.

  1. Example 1Find a second derivative
  2. Example 2Use higher-derivative notation
  3. Example 3Interpret successive rates
  4. Example 4Recognize a repeating derivative pattern

The derivative \(f'\) of a function \(f\) is itself a function, so it can have a derivative of its own. Where \(f'\) is differentiable, its derivative is the second derivative of \(f\), written \(f''\) and read “f double prime”:

\[f''(x)=\lim_{h\to 0}\frac{f'(x+h)-f'(x)}{h}\]

This topic asks what the second derivative measures and what it means for motion, how to write the derivatives after it, and when they repeat.

The slope of the slope

Three graphs, one above another, on the same x-scale from 0 to 4. The top graph is f(x) = x³/3 − 2x² + 3x, with an orange point and its orange tangent line. The middle graph is f′(x) = x² − 4x + 3, red where it falls and green where it rises, with an orange bar from its axis to f′(x) and an orange tangent line. The bottom graph is the line f″(x) = 2x − 4, with an orange bar from its axis to f″(x). A faint dashed line marks x on all three graphs, and each tangent line has its slope beside it. A button bends the middle graph into a V with its corner at x = 2. There the middle graph has no tangent line, and the bottom graph becomes two flat pieces, at −4/3 and 4/3, each with an open ring at its end.

Figure 1The graphs of \(f\), \(f'\) and \(f''\) are stacked on the same \(x\)-scale, and a faint dashed line marks \(x\) on all three. At \(x\), orange tangent lines touch \(f\) and \(f'\) at orange points, and orange bars reach \(f'(x)\) and \(f''(x)\). Each tangent line has its slope beside it, and the middle graph is green where its slope is positive and red where it is negative.

Figure 1 graphs \(f(x)=\tfrac13x^3-2x^2+3x\) at the top. The power rule, applied to each term, gives the middle graph, \(f'(x)=x^2-4x+3\), and then the bottom graph, \(f''(x)=2x-4\). At \(x\), the orange bar on the middle graph reaches \(f'(x)\), the slope of the orange tangent line on the top graph. In the same way, the bar on the bottom graph reaches \(f''(x)\), the slope of the orange tangent line on the middle graph.

At the start, \(x=1\), where \(f'(1)=0\). The tangent line on the top graph is horizontal, and the bar on the middle graph has no height. Yet the middle graph falls through 0 there, with the slope \(f''(1)=-2\). The value of \(f'\) at a point does not give \(f''\) there, because \(f''\) measures how fast \(f'\) changes, not how large it is.

The middle graph is green where its slope \(f''\) is positive and red where it is negative. Move \(x\) across the figure. While the point on the middle graph is on the green part, the bar on the bottom graph lies above the axis. On the red part, the bar lies below it. If \(f''(x)>0\), then \(f'\) increases at \(x\), as any function does where its rate of change is positive. The tangent lines on the top graph then turn counterclockwise as the point moves to the right. If \(f''(x)<0\), they turn clockwise.

The second derivative exists at \(x\) only if \(f'\) is differentiable at \(x\). Use the button under Figure 1 to put a corner in \(f'\) at \(x=2\). The middle graph bends into a V. The bottom graph becomes two flat pieces at the slopes of the two sides, \(-\tfrac43\) and \(\tfrac43\), each with an open ring at its end. The top graph changes too, but it keeps a tangent line at every point, so \(f'\) still exists everywhere. Then move the point onto the corner. The V has no tangent line there, so \(f''(2)\) does not exist.

Higher orders, notation and motion

The derivative of \(f''\) is the third derivative, \(f'''\), and the derivative of \(f'''\) is the fourth, written \(f^{(4)}\). In general, the derivative of \(f^{(n-1)}\) is the \(n\)th derivative \(f^{(n)}\). Its order \(n\) is the number of differentiations, so \(f^{(0)}\) is \(f\) itself. The parentheses keep the order apart from a power: \(f^{(2)}(x)\) is \(f''(x)\), while \(f(x)^2\) is the square of the value \(f(x)\).

With \(y=f(x)\), the second derivative is also written \(y''\), and the \(n\)th derivative \(y^{(n)}\). Leibniz notation writes the second derivative \(\frac{d}{dx}\left(\frac{dy}{dx}\right)\) as \(\frac{d^2y}{dx^2}\), and the \(n\)th as \(\frac{d^ny}{dx^n}\). The 2s in \(\frac{d^2y}{dx^2}\) count differentiations too, so it is not \(\left(\frac{dy}{dx}\right)^2\). For \(y=x^3\), the second derivative is \(\frac{d^2}{dx^2}\left(x^3\right)=6x\), but the square of \(\frac{dy}{dx}=3x^2\) is \(9x^4\).

To find \(f''(1)\), differentiate twice while \(x\) is a variable. Then substitute 1 for \(x\). Substituting first would differentiate the number \(f'(1)\), whose derivative is 0 whatever \(f\) is.

For an object that moves along a line with position \(s(t)\) at time \(t\), the velocity \(v(t)=s'(t)\) is the rate of change of position. The acceleration \(a(t)=v'(t)=s''(t)\) is the rate of change of velocity, so in Leibniz notation \(a=\frac{d^2s}{dt^2}\). Each rate divides a change by a time. With \(s\) in meters and \(t\) in seconds, \(v\) is in meters per second. Then \(a\) is in meters per second per second, written m/s². If \(v>0\), the position increases, so the object moves in the positive direction. If \(v<0\), it moves in the negative direction. If \(a>0\), the velocity increases at that instant. If \(a<0\), it decreases.

Derivatives that repeat

Topic 2.7 gives \(\frac{d}{dx}\sin x=\cos x\) and \(\frac{d}{dx}\cos x=-\sin x\). With the constant multiple rule, four differentiations of \(\sin x\) give \(\cos x\), \(-\sin x\), \(-\cos x\) and \(\sin x\) again. The fourth derivative is the function itself, so the derivatives after it repeat these four functions in the same order, a cycle of four.

A wave for x from −6.5 to 6.5, drawn over a faint dashed copy of the graph of sin x. The wave starts as sin x. Each press of Differentiate replaces it with its derivative, which is the wave moved a quarter of a period, π/2, to the left: cos x, then −sin x, then −cos x, and after four presses sin x again, on the faint copy. A formula above the wave names the derivative, such as the second derivative of sin x equals −sin x.

Figure 2The solid curve starts as \(\sin x\), and the faint dashed curve is a copy of it. Each press of Differentiate replaces the solid curve with its derivative, and the formula above the curve names that derivative.

Figure 2 shows why the cycle has four steps. The chain rule and the identity \(\cos\theta=\sin\left(\theta+\frac{\pi}{2}\right)\) give, for every constant \(c\),

\[\frac{d}{dx}\sin(x+c)=\sin\left(x+c+\frac{\pi}{2}\right)\]

so each differentiation moves the curve \(\frac{\pi}{2}\) to the left. Press Differentiate four times. The curve moves \(2\pi\), one period of sine, and lies on the faint dashed copy of \(\sin x\) again.

For the \(n\)th derivative, divide \(n\) by 4. If \(n=4q+r\), where the remainder \(r\) is 0, 1, 2 or 3, the first \(4q\) derivatives make \(q\) full cycles and return to \(\sin x\). The \(n\)th derivative is therefore the \(r\)th: \(\sin x\), \(\cos x\), \(-\sin x\) or \(-\cos x\) for \(r=0\), 1, 2 or 3. The derivatives of \(\cos x\) follow the same cycle, starting from \(\cos x\).

With a constant \(k\) inside, the chain rule brings out a factor \(k\) at each step, as in \(\frac{d}{dx}\sin(kx)=k\cos(kx)\). The functions follow the same cycle in \(kx\), and \(n\) steps give the factor \(k^n\). In the same way, \(\frac{d}{dx}e^{kx}=ke^{kx}\), so \(n\) differentiations give \(k^ne^{kx}\), and every derivative of \(e^x\) is \(e^x\). If \(k<0\), then \(k^n\) is positive for even \(n\) and negative for odd \(n\).

The pattern needs \(k\) to be a constant. For \(\sin\left(x^2\right)\), the chain rule brings out \(2x\), which changes with \(x\). Each later step then needs the product rule, and the fourth derivative is not a constant multiple of \(\sin\left(x^2\right)\).

Example 1

Find a second derivative

Let \(g(x)=\ln\left(x^2+1\right)\). Find \(g''(x)\) and \(g''(3)\).

Solution

Because \(x^2+1\ge 1\) for every \(x\), the logarithm is differentiable at \(x^2+1\), so \(g\) is differentiable for every \(x\). By the chain rule,

\[g'(x)=\frac{1}{x^2+1}\cdot 2x=\frac{2x}{x^2+1}\]

The first derivative is a quotient whose denominator is never 0, so it is differentiable for every \(x\) too. The quotient rule differentiates the whole quotient, denominator included:

\[\begin{aligned}g''(x)&=\frac{2\left(x^2+1\right)-2x\cdot 2x}{\left(x^2+1\right)^2}\\&=\frac{2-2x^2}{\left(x^2+1\right)^2}\end{aligned}\]

At \(x=3\), the denominator is \(10^2=100\), so

\[g''(3)=\frac{2-18}{100}=-\frac{4}{25}\]

Example 2

Use higher-derivative notation

Let \(y=x^4-3x^3\). Find \(\dfrac{d^2y}{dx^2}\) and \(\left(\dfrac{dy}{dx}\right)^2\) at \(x=1\), and find \(y^{(4)}\).

Solution

A polynomial has derivatives of every order for every \(x\). Both derivatives are taken while \(x\) is still a variable:

\[\begin{aligned}\frac{dy}{dx}&=4x^3-9x^2\\\frac{d^2y}{dx^2}&=12x^2-18x\end{aligned}\]

At \(x=1\), the second derivative is \(12-18=-6\). The first derivative there is \(4-9=-5\), and its square is

\[\left(\frac{dy}{dx}\right)^2=(-5)^2=25\]

Each differentiation lowers the degree of a polynomial by 1, so two more differentiations reach a constant:

\[y'''=24x-18,\qquad y^{(4)}=24\]

Example 3

Interpret successive rates

A particle moves along a line. Its position at time \(t\) seconds is \(s(t)=t^3-8t^2+20t\) meters. Find its velocity and its acceleration at \(t=1\), with units. At \(t=1\), in which direction is the particle moving, and is its velocity increasing or decreasing? Give a reason for each answer.

Solution

The position is a polynomial, so it has derivatives of every order. The velocity is the derivative of the position, and the acceleration is the derivative of the velocity:

\[\begin{aligned}v(t)&=s'(t)=3t^2-16t+20\\a(t)&=v'(t)=6t-16\end{aligned}\]

At \(t=1\), with the unit of each rate,

\[\begin{aligned}v(1)&=3-16+20=7\ \text{m/s}\\a(1)&=6-16=-10\ \text{m/s}^2\end{aligned}\]

The velocity is positive, so the particle moves in the positive direction. The acceleration is negative, so at \(t=1\) the velocity is decreasing, at 10 meters per second per second.

Example 4

Recognize a repeating derivative pattern

Let \(p(x)=\sin(2x)+e^{-x}\). Find \(p^{(35)}(x)\) and \(p^{(35)}(0)\).

Solution

Both terms have derivatives of every order for every \(x\). The derivative of a sum is the sum of the derivatives, so each term follows its own pattern. For \(\sin(2x)\), the order 35 leaves the remainder 3 when it is divided by 4:

\[35=4\cdot 8+3\]

The third derivative of \(\sin x\) is \(-\cos x\), and each of the 35 differentiations brings out the factor 2. The 35th derivative of \(\sin(2x)\) is therefore \(-2^{35}\cos(2x)\). For \(e^{-x}\), each differentiation multiplies by \(-1\), and \((-1)^{35}=-1\). Together,

\[p^{(35)}(x)=-2^{35}\cos(2x)-e^{-x}\]

At \(x=0\), \(\cos 0=1\) and \(e^0=1\), so \(p^{(35)}(0)=-2^{35}-1\).

Each example is one of the four skills of topic 3.6 in Which & Why: AP Calculus.