Tutorials › Real Analysis › Higher Derivatives

Differentiation · Tutorial 412 of 1000

Higher Derivatives

Learn to define and compute higher derivatives, and see how repeated differentiation extends the Chain Rule and Product Rule.

Advanced 10 min read

What You'll Learn

  • Define higher derivatives recursively and distinguish existence from continuity
  • Interpret the second derivative as the derivative of the first derivative
  • Calculate successive derivatives and identify when a second derivative fails to exist
  • Apply and prove the second-order Chain Rule
  • Use the generalized Product Rule for derivatives of any finite order

From First Derivatives to Repeated Differentiation

The derivative of a function is itself a function, wherever the original function is differentiable. It is therefore natural to ask whether that derivative is differentiable in turn. If so, its derivative is called the second derivative of the original function. Repeating this process gives higher derivatives. These derivatives describe more than a succession of calculations: the second derivative records how the first derivative changes, and higher derivatives describe further changes in that rate.

The Implicit Differentiation tutorial used the Chain Rule and Product Rule to find the first derivative of a branch defined by an equation. Repeated differentiation extends those tools, but it also requires care: the existence of \(f'(a)\) does not guarantee that \(f''(a)\) exists. We begin by defining precisely what repeated differentiability means.

Definition (Higher Derivatives): Let \(I\) be an open interval and \(f:I\to\mathbb{R}\). Set \(f^{(0)}=f\). Recursively, if \(f^{(k-1)}\) is defined on \(I\) and differentiable there, define $$ f^{(k)}(x)=\bigl(f^{(k-1)}\bigr)'(x). $$ The second derivative is also written \(f''\), and the third derivative \(f'''\). In general, \(f^{(k)}\) is the \(k\)th derivative. The function is \(k\) times differentiable on \(I\) if these derivatives exist on \(I\) through order \(k\).

This definition is recursive: \(f''\) is not obtained by differentiating \(f\) twice in one step. First \(f'\) must exist, and then \(f'\) must itself be differentiable. At a point \(a\), \(f''(a)\) is the derivative of \(f'\) at \(a\). In particular, \(f'\) must be defined at points sufficiently near \(a\) for that derivative to be formed.

Definition (\(C^k\) and Smooth Functions): A function \(f:I\to\mathbb{R}\) is of class \(C^k\) if its derivatives \(f^{(j)}\) exist and are continuous on \(I\) for every \(j=0,1,\ldots,k\). It is smooth, or of class \(C^\infty\), if it is of class \(C^k\) for every positive integer \(k\).

Being \(k\) times differentiable is not the same as being \(C^k\): the latter also requires continuity of the derivatives through order \(k\). For instance, existence of \(f''\) does not, by definition alone, assert continuity of \(f''\). We will use “twice differentiable” for existence of the first and second derivatives, and “\(C^2\)” when continuity of those derivatives is also part of the hypothesis.

Calculating Successive Derivatives

To find higher derivatives, differentiate the formula for the preceding derivative, keeping track of where each rule is applied. A derivative formula is not merely a list of values at one point: it gives a function that can itself be differentiated, provided the required derivatives exist.

Worked Example: Repeated Derivatives of a Polynomial

Let \(f(x)=x^5-2x^3+4x-1\). By the Power Rule and Sum Rule,

$$ f'(x)=5x^4-6x^2+4. $$

Differentiate this expression to obtain the second derivative, and continue:

$$ f''(x)=20x^3-12x,\qquad f'''(x)=60x^2-12,\qquad f^{(4)}(x)=120x,\qquad f^{(5)}(x)=120. $$

The next derivative is \(f^{(6)}(x)=0\), and every subsequent derivative is also zero. Each step differentiates the formula obtained at the preceding step. For example, differentiating \(60x^2-12\) gives \(120x\), and differentiating \(120x\) gives \(120\).

A particularly important higher derivative is \(f''\). If \(f'\) is increasing, then its slopes are nonnegative wherever those slopes exist, so \(f''\) is nonnegative there. Conversely, a second derivative gives information about how the first derivative changes. Such interpretations will be useful later, but they do not replace the definition: \(f''(a)\) is specifically the limit defining the derivative of \(f'\) at \(a\).

Worked Example: A First Derivative That Has No Derivative at the Origin

Define \(f(x)=x|x|\). For \(x>0\), \(f(x)=x^2\), and for \(x<0\), \(f(x)=-x^2\). At \(x=0\), \(f(0)=0\), and the difference quotient is

$$ \frac{f(h)-f(0)}{h} =\frac{h|h|}{h}=|h|\quad (h\ne0). $$

As \(h\to0\), \(|h|\to0\), so \(f'(0)=0\). Away from zero, differentiating the two formulas gives \(f'(x)=2x\) for \(x>0\) and \(f'(x)=-2x\) for \(x<0\). Together with the value at zero, this says \(f'(x)=2|x|\) for every \(x\).

To test whether \(f''(0)\) exists, take the difference quotient of \(f'\) at zero:

$$ \frac{f'(h)-f'(0)}{h} =\frac{2|h|}{h} = \begin{cases} 2,&h>0,\\ -2,&h<0. \end{cases} $$

The right-hand and left-hand limits differ, so this quotient has no two-sided limit. Thus \(f'(0)\) exists, but \(f''(0)\) does not. This example shows why one must check each stage of the recursive definition rather than assume that a first derivative can automatically be differentiated again.

The Second-Order Chain Rule

The Chain Rule gives the first derivative of a composite function. Differentiating that formula once more produces a second-order version. The two terms in the result reflect two ways the first derivative can change: the outer derivative can change as its input changes, and the inner derivative can change.

Theorem (Second-Order Chain Rule): Let \(I\) and \(J\) be open intervals, let \(u:I\to J\) be twice differentiable, and let \(f:J\to\mathbb{R}\) be twice differentiable. Then \(f\circ u\) is twice differentiable on \(I\), and $$ (f\circ u)''(x)=f''(u(x))\bigl(u'(x)\bigr)^2+f'(u(x))u''(x). $$

Proof. By the Chain Rule, at every \(x\in I\),

$$ (f\circ u)'(x)=f'(u(x))u'(x). $$

Since \(f\) is twice differentiable, \(f'\) is differentiable; since \(u\) is twice differentiable, \(u'\) is differentiable. Differentiate the displayed product using the Product Rule. Applying the Chain Rule to the first factor gives

$$ \begin{aligned} (f\circ u)''(x) &=f''(u(x))u'(x)u'(x)+f'(u(x))u''(x)\\ &=f''(u(x))\bigl(u'(x)\bigr)^2+f'(u(x))u''(x). \end{aligned} $$

Both terms exist under the stated hypotheses, which also proves that the composite is twice differentiable. \(\square\)

The square on \(u'(x)\) is essential. One factor comes from differentiating \(f'(u(x))\) by the Chain Rule; the other remains in the product from the first-derivative formula. Omitting either factor gives an incorrect second derivative.

Worked Example: A Composite Polynomial

Let \(g(x)=(x^2+1)^3\). Regard this as \(f(u(x))\), where \(u(x)=x^2+1\) and \(f(t)=t^3\). The needed derivatives are

$$ u'(x)=2x,\quad u''(x)=2,\quad f'(t)=3t^2,\quad f''(t)=6t. $$

The Second-Order Chain Rule gives

$$ \begin{aligned} g''(x) &=6(x^2+1)(2x)^2+3(x^2+1)^2(2)\\ &=24x^2(x^2+1)+6(x^2+1)^2\\ &=6(x^2+1)(5x^2+1). \end{aligned} $$

For a check, the first derivative is \(g'(x)=6x(x^2+1)^2\). Differentiating by the Product Rule gives \(6(x^2+1)^2+24x^2(x^2+1)\), which agrees with the expression above. In particular, at \(x=0\), the formula gives \(g''(0)=6\), and the direct expression gives \(6(1)^2+0=6\).

The Product Rule at Every Order

Repeatedly applying the ordinary Product Rule produces a pattern. When differentiating a product \(n\) times, a term appears for every way of assigning some of the \(n\) differentiations to the first factor and the rest to the second. The binomial coefficients count how many assignments produce each pair of derivative orders.

Theorem (Generalized Product Rule): Let \(I\) be an open interval, and suppose \(f,g:I\to\mathbb{R}\) have derivatives through order \(n\) on \(I\). Then \(fg\) has derivatives through order \(n\), and $$ (fg)^{(n)}(x)=\sum_{k=0}^{n}\binom{n}{k}f^{(k)}(x)g^{(n-k)}(x). $$ Here \(\binom{n}{k}=\frac{n!}{k!(n-k)!}\), with \(0!=1\).

Proof. We prove the formula by induction on \(n\). For \(n=0\), it says \((fg)^{(0)}=f^{(0)}g^{(0)}\), which is the definition of \(fg\). For \(n=1\), it is the Product Rule:

$$ (fg)'=f'g+fg'. $$

Now suppose the formula holds for some nonnegative integer \(n\), and suppose \(f\) and \(g\) have derivatives through order \(n+1\). Differentiate each term in the formula for \((fg)^{(n)}\), using the Product Rule:

$$ \begin{aligned} (fg)^{(n+1)} &=\sum_{k=0}^{n}\binom{n}{k} \left(f^{(k+1)}g^{(n-k)}+f^{(k)}g^{(n-k+1)}\right). \end{aligned} $$

In the first sum, set \(j=k+1\); in the second, set \(j=k\). For each interior index \(1\le j\le n\), the coefficient of \(f^{(j)}g^{(n+1-j)}\) becomes \(\binom{n}{j-1}+\binom{n}{j}=\binom{n+1}{j}\), by Pascal’s identity. At the endpoints, the terms are \(f^{(n+1)}g\) and \(fg^{(n+1)}\), each with coefficient \(1\). Therefore

$$ (fg)^{(n+1)} =\sum_{j=0}^{n+1}\binom{n+1}{j}f^{(j)}g^{(n+1-j)}. $$

This proves the formula for \(n+1\), completing the induction. The same calculation shows that the product has the required derivatives at each stage. \(\square\)

Worked Example: A Third Derivative of a Product

Take \(f(x)=x^2\) and \(g(x)=x^3\). Their derivatives are

$$ f'=2x,\quad f''=2,\quad f'''=0,\qquad g'=3x^2,\quad g''=6x,\quad g'''=6. $$

The Generalized Product Rule for \(n=3\) gives

$$ \begin{aligned} (fg)''' &=f'''g+3f''g'+3f'g''+fg'''\\ &=0\cdot x^3+3(2)(3x^2)+3(2x)(6x)+x^2(6)\\ &=18x^2+36x^2+6x^2\\ &=60x^2. \end{aligned} $$

As a direct check, \(fg=x^5\), so \((fg)'''=5\cdot4\cdot3\,x^2=60x^2\). The coefficients \(1,3,3,1\) in the product formula are the binomial coefficients for order three.

What Higher Derivatives Do—and Do Not—Guarantee

The generalized Product Rule and second-order Chain Rule are practical tools because they let us differentiate expressions without expanding them first. They also clarify the hypotheses needed: to use a second derivative, the first derivative must itself be differentiable; to use the order-\(n\) product formula, both factors must have derivatives through order \(n\).

A common pitfall is to confuse higher differentiability with smoothness. A function can have a second derivative without that second derivative being continuous, because continuity of \(f''\) is an additional condition in the definition of \(C^2\). Another pitfall is to treat a formal expression for \(f''\) as proof that it exists at every point. The example \(x|x|\) shows why the derivative limit must be checked where the formula changes.

When applying these ideas, first identify the function whose derivative is being taken. For a composite, use the Chain Rule before differentiating again; for a product, decide whether successive Product Rule steps or the generalized formula is more efficient. In either case, verify that the derivatives required by the rule exist on the relevant interval.

Check Your Understanding

Use the definitions and results in this tutorial to answer the following.

  1. State the recursive definition of \(f^{(k)}\) in terms of \(f^{(k-1)}\).
  2. What additional requirement distinguishes a \(C^2\) function from a twice differentiable function?
  3. Use the Second-Order Chain Rule to find the second derivative of \(h(x)=(3x+1)^4\).
  4. Write the Generalized Product Rule for \((fg)^{(4)}\), including its coefficients.
  5. For \(f(x)=x|x|\), why does \(f'(0)\) exist while \(f''(0)\) does not?