Calculus · Differential Calculus

Higher Derivatives and Differentials: Taking the Derivative Again (and Again)

The derivative of a function is itself a function, so nothing stops us from differentiating it again. The second derivative tells us about acceleration and curvature, and higher derivatives are the building blocks of Taylor series. This post covers how to compute them, including Leibniz's formula for products and the formulas for curves given in parametric form.

1. Derivatives of higher order

Definition Higher derivatives of \(y = f(x)\) are defined step by step: \[ y'' = (y')', \qquad y''' = (y'')', \qquad \dots, \qquad y^{(n)} = f^{(n)}(x) = \big\{f^{(n-1)}(x)\big\}' \quad (n = 2, 3, \dots), \] assuming each of these derivatives exists.

Notation: the first three are usually written with primes, \(y', y'', y'''\); from the fourth on, with the order in brackets, \(y^{(4)}, y^{(5)}, \dots\) (brackets, so that \(y^{(4)}\) isn't confused with the power \(y^4\)). In Leibniz's notation, \( y'' = \frac{d^2y}{dx^2} \) and \( y^{(n)} = \frac{d^ny}{dx^n} \).

What does the second derivative mean?

Example 1 · Motion A point moves along a line according to \( s(t) = t^3 - 6t^2 + 9t \). Then \[ v(t) = s'(t) = 3t^2 - 12t + 9, \qquad a(t) = s''(t) = 6t - 12. \] At \(t = 2\) the acceleration is zero: the point stops slowing down and starts speeding up (in the positive direction). On the graph of \(s\), this is where the curve changes from concave to convex.

2. Finding a formula for the n-th derivative

For many functions, a pattern appears after a few derivatives. The technique: compute the first three or four, guess the pattern, and confirm it by induction.

Example 2 · Powers For \(y = x^m\): \( y' = mx^{m-1} \), \( y'' = m(m-1)x^{m-2} \), and in general \[ (x^m)^{(n)} = m(m-1)\cdots(m-n+1)\,x^{m-n}. \] If \(m\) is a natural number, then \( (x^m)^{(m)} = m! \), and every higher derivative is \(0\). A polynomial of degree \(m\) "dies" after \(m + 1\) differentiations.
Example 3 · Sine and cosine \( (\sin x)' = \cos x = \sin\big(x + \frac\pi2\big) \): each differentiation shifts the argument by \(\frac\pi2\). Hence \[ (\sin x)^{(n)} = \sin\Big(x + \frac{n\pi}{2}\Big), \qquad (\cos x)^{(n)} = \cos\Big(x + \frac{n\pi}{2}\Big). \] The derivatives repeat with period 4: \( \sin x \to \cos x \to -\sin x \to -\cos x \to \sin x \).
Example 4 · \( \frac1x \) and the exponential \[ \left(\frac1x\right)' = -\frac{1}{x^2}, \quad \left(\frac1x\right)'' = \frac{2}{x^3}, \quad \left(\frac1x\right)''' = -\frac{6}{x^4}, \quad\dots,\quad \left(\frac1x\right)^{(n)} = \frac{(-1)^n\,n!}{x^{n+1}}. \] And since \( (e^{ax})' = a\,e^{ax} \), each step brings out one more factor \(a\): \[ (e^{ax})^{(n)} = a^n\,e^{ax}. \]
Functionn-th derivative
\( x^m \)\( m(m-1)\cdots(m-n+1)\,x^{m-n} \)
\( e^{ax} \)\( a^ne^{ax} \)
\( \sin x \)\( \sin\big(x + \frac{n\pi}{2}\big) \)
\( \cos x \)\( \cos\big(x + \frac{n\pi}{2}\big) \)
\( \frac{1}{x} \)\( \frac{(-1)^nn!}{x^{n+1}} \)

3. Leibniz's formula for the n-th derivative of a product

The product rule gives \( (uv)' = u'v + uv' \). Differentiate once more:

\[ (uv)'' = u''v + 2u'v' + uv'', \qquad (uv)''' = u'''v + 3u''v' + 3u'v'' + uv'''. \]

The coefficients \(1, 2, 1\) and \(1, 3, 3, 1\) are rows of Pascal's triangle, exactly as in \((a + b)^2\) and \((a + b)^3\). This is no accident.

Leibniz's formula If \(y = uv\), where \(u = \varphi(x)\) and \(v = \psi(x)\) have derivatives up to order \(n\), then \[ y^{(n)} = (uv)^{(n)} = u^{(n)}v + n\,u^{(n-1)}v' + \frac{n(n-1)}{2!}\,u^{(n-2)}v'' + \cdots + uv^{(n)}, \] or, with binomial coefficients, \[ (uv)^{(n)} = \sum_{k=0}^{n}\binom nk\,u^{(n-k)}\,v^{(k)}. \]

Memory aid: expand \((u + v)^n\) with the binomial theorem, then turn powers into orders of derivatives (\(u^{n-k}v^k \to u^{(n-k)}v^{(k)}\), with \(u^{(0)} = u\)). The proof is by induction, using the product rule and the Pascal identity \( \binom nk + \binom n{k-1} = \binom{n+1}k \), the same argument that proves the binomial theorem.

When it is most useful: when one factor is a polynomial. A polynomial of degree \(m\) has only \(m + 1\) non-zero derivatives, so the sum stops after \(m + 1\) terms, however large \(n\) is.

Example 5 · \( (x^2\sin x)^{(10)} \) Take \(v = x^2\) (so \(v' = 2x\), \(v'' = 2\), \(v''' = 0\)) and \(u = \sin x\). Only three terms survive: \[ (x^2\sin x)^{(10)} = x^2\sin\Big(x + \frac{10\pi}{2}\Big) + 10\cdot 2x\,\sin\Big(x + \frac{9\pi}{2}\Big) + \frac{10\cdot 9}{2}\cdot 2\,\sin\Big(x + \frac{8\pi}{2}\Big). \] Simplifying the sines (\(\sin(x + 5\pi) = -\sin x\), \(\sin(x + \frac{9\pi}{2}) = \cos x\), \(\sin(x + 4\pi) = \sin x\)): \[ (x^2\sin x)^{(10)} = -x^2\sin x + 20x\cos x + 90\sin x. \] Computing ten derivatives one after another would take a page.
Example 6 · \( (x\,e^{2x})^{(n)} \) With \(u = e^{2x}\), \(v = x\): only two terms are non-zero, \[ (xe^{2x})^{(n)} = 2^ne^{2x}\cdot x + n\cdot 2^{n-1}e^{2x}\cdot 1 = 2^{n-1}e^{2x}(2x + n). \]

4. Higher derivatives of parametric functions

Many curves are easier to describe with a parameter \(t\) (often time) than as \(y = f(x)\):

\[ x = \varphi(t), \qquad y = \psi(t). \]

We'll write derivatives with respect to \(t\) with dots (Newton's notation), common in physics:

\[ \dot x = \frac{dx}{dt},\quad \dot y = \frac{dy}{dt},\quad \ddot x = \frac{d^2x}{dt^2},\quad \ddot y = \frac{d^2y}{dt^2}. \]

From the previous posts, the first derivative is a quotient of differentials:

\[ y'_x = \frac{dy}{dx} = \frac{dy/dt}{dx/dt} = \frac{\dot y}{\dot x}. \]

The key point for the second derivative: \(y'_x\) is again given as a function of \(t\). So we apply the same rule to it: differentiate with respect to \(t\), then divide by \(\dot x\).

Second derivative of a parametric function \[ y''_x = \frac{d^2y}{dx^2} = \frac{d}{dx}(y') = \frac{d}{dx}\left(\frac{\dot y}{\dot x}\right) = \frac{\dfrac{d}{dt}\left(\dfrac{\dot y}{\dot x}\right)}{\dfrac{dx}{dt}}, \] or, after applying the quotient rule, \[ y''_x = \frac{\dot x\,\ddot y - \ddot x\,\dot y}{(\dot x)^3}. \]

Derivation of the compact form: \( \frac{d}{dt}\left(\frac{\dot y}{\dot x}\right) = \frac{\ddot y\,\dot x - \dot y\,\ddot x}{\dot x^2} \); dividing by \(\dot x\) gives the cube in the denominator.

The third (and every higher) derivative follows the same pattern:

\[ y'''_x = \frac{\dfrac{d(y''_x)}{dt}}{\dfrac{dx}{dt}}, \quad \text{etc.} \]
The most common mistake The second derivative is not \( \frac{\ddot y}{\ddot x} \). Second derivatives with respect to \(t\) do not simply divide. Always differentiate \(y'_x\) with respect to \(t\) and then divide by \(\dot x\) (not by \(\ddot x\)).
Example 7 · The circle \( x = a\cos t \), \( y = a\sin t \). Then \( \dot x = -a\sin t \), \( \dot y = a\cos t \), \( \ddot x = -a\cos t \), \( \ddot y = -a\sin t \): \[ y'_x = \frac{a\cos t}{-a\sin t} = -\operatorname{ctg}t, \qquad y''_x = \frac{(-a\sin t)(-a\sin t) - (-a\cos t)(a\cos t)}{(-a\sin t)^3} = \frac{a^2}{-a^3\sin^3t} = -\frac{1}{a\sin^3t}. \]

Check: the upper half of the circle is \( y = \sqrt{a^2 - x^2} \), with \( y'' = -\frac{a^2}{(a^2 - x^2)^{3/2}} \). Substituting \( a^2 - x^2 = a^2\sin^2t \) gives \( -\frac{a^2}{a^3\sin^3t} \), the same. Negative, as it should be: the upper half-circle bends downward.

Example 8 · The cycloid The curve traced by a point on a rolling wheel: \( x = a(t - \sin t) \), \( y = a(1 - \cos t) \). Here \( \dot x = a(1 - \cos t) \), \( \dot y = a\sin t \), \( \ddot x = a\sin t \), \( \ddot y = a\cos t \): \[ \dot x\ddot y - \ddot x\dot y = a^2\big[(1 - \cos t)\cos t - \sin^2t\big] = a^2(\cos t - 1), \] \[ y''_x = \frac{a^2(\cos t - 1)}{a^3(1 - \cos t)^3} = -\frac{1}{a(1 - \cos t)^2}. \] Always negative: every arch of the cycloid bends downward.

5. Differentials of higher order

Definition Differentials of higher order of \(y = f(x)\) are also defined step by step: \[ d^ny = d\big(d^{n-1}y\big) \quad (n = 2, 3, \dots), \] where \( d^1y = dy = y'\,dx \).

If \(x\) is the independent variable, then \(dx = \Delta x\) is a fixed increment that does not depend on \(x\). So when we differentiate again, \(dx\) behaves like a constant: \( d^2x = d^3x = \cdots = d^nx = 0 \), and

\[ d^2y = d(y'\,dx) = dx\cdot d(y') = dx\cdot y''\,dx = y''\,dx^2. \]

Continuing in the same way:

Formula (x independent) \[ d^ny = y^{(n)}\,dx^n \qquad \text{and} \qquad y^{(n)} = \frac{d^ny}{dx^n}. \] Here \(dx^n\) means \((dx)^n\), the \(n\)-th power of the differential (not the differential of \(x^n\)).

This formula justifies Leibniz's notation \( \frac{d^ny}{dx^n} \): the \(n\)-th derivative is literally the quotient of the \(n\)-th differential of \(y\) by the \(n\)-th power of \(dx\).

Example 9 For \( y = x^3 \): \( dy = 3x^2\,dx \), \( d^2y = 6x\,dx^2 \), \( d^3y = 6\,dx^3 \), and \( d^4y = 0 \).
Invariance is lost for \(n \ge 2\) In the previous post we saw that \(dy = y'\,dx\) keeps its form even when \(x\) depends on another variable. This is no longer true for higher differentials. If \(x\) is itself a function of some variable \(t\), then \(d^2x \ne 0\) in general, and the product rule gives \[ d^2y = d(y'\,dx) = y''\,dx^2 + y'\,d^2x. \] The formula \( d^ny = y^{(n)}dx^n \) holds only when \(x\) is the independent variable.
Example 10 · Seeing the extra term Let \(y = x^2\) and \(x = t^2\), so that \(y = t^4\) and, with \(t\) independent, \( d^2y = 12t^2\,dt^2 \).

Using the formula \( y''dx^2 \) alone: \( 2\cdot(2t\,dt)^2 = 8t^2\,dt^2 \), which is wrong.

With the correction: \( y'\,d^2x = 2x\cdot 2\,dt^2 = 4t^2\,dt^2 \), and \( 8t^2\,dt^2 + 4t^2\,dt^2 = 12t^2\,dt^2 \). ✓

6. Summary

ConceptFormula
n-th derivative\( y^{(n)} = \big\{y^{(n-1)}\big\}' \)
Leibniz's formula\( (uv)^{(n)} = \sum_{k=0}^n \binom nk u^{(n-k)}v^{(k)} \)
Parametric, 1st derivative\( y'_x = \frac{\dot y}{\dot x} \)
Parametric, 2nd derivative\( y''_x = \frac{\dot x\ddot y - \ddot x\dot y}{\dot x^3} \)
Parametric, higher\( y^{(n)}_x = \frac{d\big(y^{(n-1)}_x\big)/dt}{dx/dt} \)
Higher differentials\( d^ny = d(d^{n-1}y) \)
\(x\) independent\( d^ny = y^{(n)}dx^n,\ \ y^{(n)} = \frac{d^ny}{dx^n} \)
\(x\) dependent\( d^2y = y''dx^2 + y'd^2x \)

7. Practice problems

Try these before opening the solution. More solved problems are in Differential Calculus.

Problem 1: Find \(y'''\) for \( y = x^5 - 3x^3 + 2 \).

\( y' = 5x^4 - 9x^2 \), \( y'' = 20x^3 - 18x \), \( y''' = 60x^2 - 18 \).

Problem 2: Find the n-th derivative of \( y = \dfrac{1}{1 - x} \).

\( y' = \frac{1}{(1-x)^2} \), \( y'' = \frac{2}{(1-x)^3} \), \( y''' = \frac{6}{(1-x)^4} \), so \( y^{(n)} = \dfrac{n!}{(1 - x)^{n+1}} \).

Problem 3: Using Leibniz's formula, find \( (x\,e^x)^{(n)} \).

\( (xe^x)^{(n)} = x\,e^x + n\cdot 1\cdot e^x = e^x(x + n) \).

Problem 4: Find \( (x^3\cos x)^{(20)} \) at \(x = 0\).

All terms contain a power of \(x\) except the one where \(x^3\) is differentiated three times: \( \binom{20}{3}\cdot 6\cdot\cos\big(x + \frac{17\pi}{2}\big) \). At \(x = 0\): \( \cos\frac{17\pi}{2} = \cos\frac{\pi}{2} = 0 \). So the value is \(0\). (Makes sense: \(x^3\cos x\) is odd, and even-order derivatives of odd functions vanish at \(0\).)

Problem 5: Find \(y''_x\) for \( x = t^2 \), \( y = t^3 \).

\( \dot x = 2t \), \( \dot y = 3t^2 \), \( \ddot x = 2 \), \( \ddot y = 6t \): \( y''_x = \dfrac{2t\cdot 6t - 2\cdot 3t^2}{(2t)^3} = \dfrac{6t^2}{8t^3} = \dfrac{3}{4t} \). Check: \( y = x^{3/2} \) (for \(t > 0\)), \( y'' = \frac34x^{-1/2} = \frac{3}{4t} \). ✓

Problem 6: Find \(d^2y\) for \(y = \sin x\), where \(x\) is the independent variable.

\( d^2y = (\sin x)''\,dx^2 = -\sin x\,dx^2 \).

Problem 7: Show that \( y = A\cos x + B\sin x \) satisfies \( y'' + y = 0 \) for any constants \(A, B\).

\( y' = -A\sin x + B\cos x \), \( y'' = -A\cos x - B\sin x = -y \). Hence \( y'' + y = 0 \). (This is the equation of a harmonic oscillator, such as a mass on a spring.)

Final thoughts

Higher derivatives are just the first derivative applied repeatedly, but they unlock new information: acceleration, curvature, and (later) Taylor polynomials, which approximate functions using \(f', f'', f''', \dots\). The two tools worth remembering from this post are Leibniz's formula, which turns a long chain of product rules into a single binomial-style sum, and the parametric rule: differentiate with respect to \(t\), then divide by \(\dot x\), as many times as needed.

Next in the series: the mean value theorems and Taylor's formula.