Calculus

Differentiation of Functions

Differentiation Logo

Leibniz Formula

The Leibniz formula expresses the derivative on \(n\)th order of the product of two functions. Suppose that the functions \(u\left( x \right)\) and \(v\left( x \right)\) have the derivatives up to \(n\)th order. Consider the derivative of the product of these functions.

The first derivative is described by the well known formula:

\[{\left( {uv} \right)^\prime } = u'v + uv'.\]

Differentiating this expression again yields the second derivative:

\[\left( {uv} \right)^{\prime\prime} = \left[ {{{\left( {uv} \right)}^\prime }} \right]^\prime = \left( {u'v + uv'} \right)^\prime = {\left( {u'v} \right)^\prime } + {\left( {uv'} \right)^\prime } = u^{\prime\prime}v + u'v' + u'v' + uv^{\prime\prime} = u^{\prime\prime}v + 2u'v' + uv^{\prime\prime}.\]

Likewise, we can find the third derivative of the product \(uv:\)

\[\left( {uv} \right)^{\prime\prime\prime} = \left[ {{\left( {uv} \right)^{\prime\prime}}} \right]^\prime = \left( {u^{\prime\prime}v + 2u'v' + uv^{\prime\prime}} \right)^\prime = {\left( {u^{\prime\prime}v} \right)^\prime } + {\left( {2u'v'} \right)^\prime } + {\left( {uv^{\prime\prime}} \right)^\prime } = u^{\prime\prime\prime}v + \color{blue}{u^{\prime\prime}v'} + \color{blue}{2u^{\prime\prime}v'} + \color{red}{2u'v^{\prime\prime}} + \color{red}{u'v^{\prime\prime}} + \color{black}{uv^{\prime\prime\prime}} = u^{\prime\prime\prime}v + \color{blue}{3u^{\prime\prime}v'} + \color{red}{3u'v^{\prime\prime}} + \color{black}{uv^{\prime\prime\prime}}.\]

It is easy to see that these formulas are similar to the binomial expansion raised to the appropriate exponent. Assuming that the terms with zero exponent \({u^0}\) and \({v^0}\) correspond to the functions \(u\) and \(v\) themselves, we can write the general formula for the derivative of \(n\)th order of the product of functions \(uv\) as follows:

\[\left( {uv} \right)^{\left( n \right)} = \sum\limits_{i = 0}^n {\left( {\begin{array}{*{20}{c}} n\\ i \end{array}} \right){u^{\left( {n - i} \right)}}{v^{\left( i \right)}}} ,\]

where \({\left( {\begin{array}{*{20}{c}} n\\ i \end{array}} \right)}\) denotes the number of \(i\)-combinations of \(n\) elements.

This formula is called the Leibniz formula and can be proved by induction.

Proof.

Suppose that the functions \(u\) and \(v\) have the derivatives of \(\left( {n + 1} \right)\)th order. Using the recurrence relation, we write the expression for the derivative of \(\left( {n + 1} \right)\)th order in the following form:

\[y^{\left( {n + 1} \right)} = \left[ {{y^{\left( n \right)}}} \right]^\prime = \left[ {{{\left( {uv} \right)}^{\left( n \right)}}} \right]^\prime = \left[ {\sum\limits_{i = 0}^n {\left( {\begin{array}{*{20}{c}} n\\ i \end{array}} \right){u^{\left( {n - i} \right)}}{v^{\left( i \right)}}} } \right]^\prime.\]

After differentiation we obtain:

\[y^{\left( {n + 1} \right)} = \sum\limits_{i = 0}^n {\left( {\begin{array}{*{20}{c}} n\\ i \end{array}} \right){u^{\left( {n - i + 1} \right)}}{v^{\left( i \right)}}} + \sum\limits_{i = 0}^n {\left( {\begin{array}{*{20}{c}} n\\ i \end{array}} \right){u^{\left( {n - i} \right)}}{v^{\left( {i + 1} \right)}}} .\]

Both sums in the right-hand side can be combined into a single sum. Indeed, take an intermediate index \(1 \le m \le n.\) The first term when \(i = m\) is written as

\[\left( {\begin{array}{*{20}{c}} n\\ m \end{array}} \right){u^{\left( {n - m + 1} \right)}}{v^{\left( m \right)}},\]

and the second term when \(i = m - 1\) is as follows:

\[\left( {\begin{array}{*{20}{c}} n\\ {m - 1} \end{array}} \right){u^{\left( {n - \left( {m - 1} \right)} \right)}}{v^{\left( {\left( {m - 1} \right) + 1} \right)}} = \left( {\begin{array}{*{20}{c}} n\\ {m - 1} \end{array}} \right){u^{\left( {n - m + 1} \right)}}{v^{\left( m \right)}}.\]

The sum of these two terms is given by

\[ \left( {\begin{array}{*{20}{c}} n\\ m \end{array}} \right){u^{\left( {n - m + 1} \right)}}{v^{\left( m \right)} + \left( {\begin{array}{*{20}{c}} n\\ {m - 1} \end{array}} \right){u^{\left( {n - m + 1} \right)}}{v^{\left( m \right)}} } = \left[ {\left( {\begin{array}{*{20}{c}} n\\ m \end{array}} \right) + \left( {\begin{array}{*{20}{c}} n\\ {m - 1} \end{array}} \right)} \right] {u^{\left( {n - m + 1} \right)}}{v^{\left( m \right)}}. \]

It is known from combinatorics that

\[\left( {\begin{array}{*{20}{c}} n\\ m \end{array}} \right) + \left( {\begin{array}{*{20}{c}} n\\ {m - 1} \end{array}} \right) = \left( {\begin{array}{*{20}{c}} {n + 1}\\ m \end{array}} \right).\]

Therefore, the sum of these two terms can be written as

\[\left[ {\left( {\begin{array}{*{20}{c}} n\\ m \end{array}} \right) + \left( {\begin{array}{*{20}{c}} n\\ {m - 1} \end{array}} \right)} \right] {u^{\left( {n - m + 1} \right)}}{v^{\left( m \right)}} = \left( {\begin{array}{*{20}{c}} {n + 1}\\ m \end{array}} \right){u^{\left( {n + 1 - m} \right)}}{v^{\left( m \right)}}. \]

It is clear that when \(m\) changes from \(1\) to \(n\) this combination will cover all terms of both sums except the term for \(i = 0\) in the first sum equal to

\[\left( {\begin{array}{*{20}{c}} n\\ 0 \end{array}} \right){u^{\left( {n - 0 + 1} \right)}}{v^{\left( 0 \right)}} = {u^{\left( {n + 1} \right)}}{v^{\left( 0 \right)}},\]

and the term for \(i = n\) in the second sum equal to

\[\left( {\begin{array}{*{20}{c}} n\\ n \end{array}} \right){u^{\left( {n - n} \right)}}{v^{\left( {n + 1} \right)}} = {u^{\left( 0 \right)}}{v^{\left( {n + 1} \right)}}.\]

As a result, the derivative of \(\left( {n + 1} \right)\)th order of the product of functions \(uv\) is represented in the form

\[y^{\left( {n + 1} \right)} = {u^{\left( {n + 1} \right)}}{v^{\left( 0 \right)}} + \sum\limits_{m = 1}^n {\left( {\begin{array}{*{20}{c}} {n + 1}\\ m \end{array}} \right){u^{\left( {n + 1 - m} \right)}}{v^{\left( m \right)}}} + {u^{\left( 0 \right)}}{v^{\left( {n + 1} \right)}} = \sum\limits_{m = 0}^{n + 1} {\left( {\begin{array}{*{20}{c}} {n + 1}\\ m \end{array}} \right){u^{\left( {n + 1 - m} \right)}}{v^{\left( m \right)}}}.\]

As you can see, the expression for \({y^{\left( {n + 1} \right)}}\) has a similar form as for the derivative \({y^{\left( n \right)}}.\) Only now the upper limit of summation is equal to \(n + 1\) instead of \(n.\) Thus, the Leibniz formula is proved for an arbitrary natural number \(n.\)

Solved Problems

Click or tap a problem to see the solution.

Example 1

Find the \(4\)th derivative of the function \[y = {e^x}\sin x.\]

Example 2

Find the \(3\)rd derivative of the function \[y = x\sin x.\]

Example 3

Find the third derivative of the function \[y = {e^{2x}}\ln x.\]

Example 4

Find the \(3\)rd derivative of the function \[y = {e^x}\cos x.\]

Example 5

Find the \(4\)th-order derivative of the function \[y = x\sinh x.\]

Example 6

Find all derivatives of the function \[y = {e^x}{x^2}.\]

Example 1.

Find the \(4\)th derivative of the function \[y = {e^x}\sin x.\]

Solution.

Let \(u = \sin x,\) \(v = {e^x}.\) Using the Leibniz formula, we can write

\[\require{cancel} {y^{\left( 4 \right)} = \left( {{e^x}\sin x} \right)^{\left( 4 \right)}} = \sum\limits_{i = 0}^4 {\left( {\begin{array}{*{20}{c}} 4\\ i \end{array}} \right){u^{\left( {4 - i} \right)}}{v^{\left( i \right)}}} = \sum\limits_{i = 0}^4 {\left( {\begin{array}{*{20}{c}} 4\\ i \end{array}} \right){{\left( {\sin x} \right)}^{\left( {4 - i} \right)}}{{\left( {{e^x}} \right)}^{\left( i \right)}}} = \left( {\begin{array}{*{20}{c}} 4\\ 0 \end{array}} \right){\left( {\sin x} \right)^{\left( 4 \right)}}{e^x} + \left( {\begin{array}{*{20}{c}} 4\\ 1 \end{array}} \right)\left( {\sin x} \right)^{\prime\prime\prime}\left( {{e^x}} \right)^\prime + \left( {\begin{array}{*{20}{c}} 4\\ 2 \end{array}} \right)\left( {\sin x} \right)^{\prime\prime}\left( {{e^x}} \right)^{\prime\prime} + \left( {\begin{array}{*{20}{c}} 4\\ 3 \end{array}} \right)\left( {\sin x} \right)^\prime\left( {{e^x}} \right)^{\prime\prime\prime} + \left( {\begin{array}{*{20}{c}} 4\\ 4 \end{array}} \right)\left( {\sin x} \right){\left( {{e^x}} \right)^{\left( 4 \right)}} = 1 \cdot \sin x \cdot {e^x} + \cancel{ 4 \cdot \left( { - \cos x} \right) \cdot {e^x} } + 6 \cdot \left( { - \sin x} \right) \cdot {e^x} + \cancel{ 4 \cdot \cos x \cdot {e^x} } + 1 \cdot \sin x \cdot {e^x} = - 4{e^x}\sin x.\]

Example 2.

Find the \(3\)rd derivative of the function \[y = x\sin x.\]

Solution.

Let \(u = \sin x,\) \(v = x.\) By the Leibniz formula, we can write:

\[y^{\prime\prime\prime} = \sum\limits_{i = 0}^3 {\left( {\begin{array}{*{20}{c}} 3\\ i \end{array}} \right){u^{\left( {3 - i} \right)}}{v^{\left( i \right)}}} = \sum\limits_{i = 0}^3 {\left( {\begin{array}{*{20}{c}} 3\\ i \end{array}} \right){{\left( {\sin x} \right)}^{\left( {3 - i} \right)}}{x^{\left( i \right)}}} .\]

It is clear that

\[x^\prime = 1,\;\; x^{\prime\prime} = x^{\prime\prime\prime} \equiv 0.\]

Then the series expansion has only two terms:

\[y^{\prime\prime\prime} = \left( {\begin{array}{*{20}{c}} 3\\ 0 \end{array}} \right)\left( {\sin x} \right)^{\prime\prime\prime}x + \left( {\begin{array}{*{20}{c}} 3\\ 1 \end{array}} \right)\left( {\sin x} \right)^{\prime\prime}x^\prime.\]

Calculating the derivatives, we obtain

\[y^{\prime\prime\prime} = 1 \cdot \left( { - \cos x} \right) \cdot x + 3 \cdot \left( { - \sin x} \right) \cdot 1 = - x\cos x - 3\sin x.\]

Example 3.

Find the third derivative of the function \[y = {e^{2x}}\ln x.\]

Solution.

We set \(u = {e^{2x}}\), \(v = \ln x\). The derivatives of the functions \(u\) and \(v\) are

\[u' = \left( {{e^{2x}}} \right)^\prime = 2{e^{2x}},\;\;\;u^{\prime\prime} = {\left( {2{e^{2x}}} \right)^\prime } = 4{e^{2x}},\;\;\;u^{\prime\prime\prime} = {\left( {4{e^{2x}}} \right)^\prime } = 8{e^{2x}},\]
\[v' = \left( {\ln x} \right)^\prime = \frac{1}{x},\;\;\;v^{\prime\prime} = {\left( {\frac{1}{x}} \right)^\prime } = - \frac{1}{{{x^2}}},\;\;\;v^{\prime\prime\prime} = {\left( { - \frac{1}{{{x^2}}}} \right)^\prime } = - {\left( {{x^{ - 2}}} \right)^\prime } = 2{x^{ - 3}} = \frac{2}{{{x^3}}}.\]

The third-order derivative of the original function is given by the Leibniz rule:

\[ {y^{\prime\prime\prime} = {\left( {{e^{2x}}\ln x} \right)^{\prime \prime \prime }} } = {\sum\limits_{i = 0}^3 {\left( {\begin{array}{*{20}{c}} 3\\ i \end{array}} \right){u^{\left( {3 - i} \right)}}{v^{\left( i \right)}}} } = {\sum\limits_{i = 0}^3 {\left( {\begin{array}{*{20}{c}} 3\\ i \end{array}} \right){{\left( {{e^{2x}}} \right)}^{\left( {3 - i} \right)}}{{\left( {\ln x} \right)}^{\left( i \right)}}} } = {\left( {\begin{array}{*{20}{c}} 3\\ 0 \end{array}} \right) \cdot 8{e^{2x}}\ln x } + {\left( {\begin{array}{*{20}{c}} 3\\ 1 \end{array}} \right) \cdot 4{e^{2x}} \cdot \frac{1}{x} } + {\left( {\begin{array}{*{20}{c}} 3\\ 2 \end{array}} \right) \cdot 2{e^{2x}} \cdot \left( { - \frac{1}{{{x^2}}}} \right) } + {\left( {\begin{array}{*{20}{c}} 3\\ 3 \end{array}} \right){e^{2x}} \cdot \frac{2}{{{x^3}}} } = {1 \cdot 8{e^{2x}}\ln x }+{ 3 \cdot \frac{{4{e^{2x}}}}{x} } - {3 \cdot \frac{{2{e^{2x}}}}{{{x^2}}} }+{ 1 \cdot \frac{{2{e^{2x}}}}{{{x^3}}} } = {8{e^{2x}}\ln x + \frac{{12{e^{2x}}}}{x} }-{ \frac{{6{e^{2x}}}}{{{x^2}}} }+{ \frac{{2{e^{2x}}}}{{{x^3}}} } = {2{e^{2x}}\cdot}\kern0pt{\left( {4\ln x + \frac{6}{x} - \frac{3}{{{x^2}}} + \frac{1}{{{x^3}}}} \right).} \]

Example 4.

Find the \(3\)rd derivative of the function \[y = {e^x}\cos x.\]

Solution.

Let \(u = \cos x,\) \(v = {e^x}.\) Using the Leibniz formula, we have

\[y^{\prime\prime\prime} = \left( {{e^x}\cos x} \right)^{\prime\prime\prime} = \sum\limits_{i = 0}^3 {\left( {\begin{array}{*{20}{c}} 3\\ i \end{array}} \right){{\left( {\cos x} \right)}^{\left( {3 - i} \right)}}{{\left( {{e^x}} \right)}^{\left( i \right)}}} = \left( {\begin{array}{*{20}{c}} 3\\ 0 \end{array}} \right)\left( {\cos x} \right)^{\prime\prime\prime}{e^x} + \left( {\begin{array}{*{20}{c}} 3\\ 1 \end{array}} \right)\left( {\cos x} \right)^{\prime\prime}\left( {{e^x}} \right)^\prime + \left( {\begin{array}{*{20}{c}} 3\\ 2 \end{array}} \right)\left( {\cos x} \right)^\prime\left( {{e^x}} \right)^{\prime\prime} + \left( {\begin{array}{*{20}{c}} 3\\ 3 \end{array}} \right)\cos x\left( {{e^x}} \right)^{\prime\prime\prime}.\]

The derivatives of cosine are

\[\left( {\cos x} \right)^\prime = - \sin x;\]
\[\left( {\cos x} \right)^{\prime\prime} = \left( { - \sin x} \right)\prime = - \cos x;\]
\[\left( {\cos x} \right)^{\prime\prime\prime} = \left( { - \cos x} \right)\prime = \sin x.\]

All derivatives of the exponential function \(v = {e^x}\) are \({e^x}.\) Hence,

\[y^{\prime\prime\prime} = 1 \cdot \sin x \cdot {e^x} + 3 \cdot \left( { - \cos x} \right) \cdot {e^x} + 3 \cdot \left( { - \sin x} \right) \cdot {e^x} + 1 \cdot \cos x \cdot {e^x} = {e^x}\left( { - 2\sin x - 2\cos x} \right) = - 2{e^x}\left( {\sin x + \cos x} \right).\]

Example 5.

Find the \(4\)th-order derivative of the function \[y = x\sinh x.\]

Solution.

We denote \(u = \sinh x,\) \(v = x.\) By the Leibniz formula,

\[{y^{\left( 4 \right)}} = {\left( {x\sinh x} \right)^{\left( 4 \right)}} = \sum\limits_{i = 0}^4 {\left( {\begin{array}{*{20}{c}} 4\\ i \end{array}} \right){{\left( {\sinh x} \right)}^{\left( {4 - i} \right)}}{x^{\left( i \right)}}} = \left( {\begin{array}{*{20}{c}} 4\\ 0 \end{array}} \right){\left( {\sinh x} \right)^{\left( 4 \right)}}x + \left( {\begin{array}{*{20}{c}} 4\\ 1 \end{array}} \right){\left( {\sinh x} \right)^{\left( 3 \right)}}x^\prime + \ldots \]

Calculate the derivatives of the hyperbolic sine function:

\[\left( {\sinh } \right)^\prime = \cosh x;\]
\[\left( {\sinh } \right)^{\prime\prime} = \left( {\cosh x} \right)^\prime = \sinh x;\]
\[\left( {\sinh } \right)^{\prime\prime\prime} = \left( {\sinh x} \right)^\prime = \cosh x;\]
\[\left( {\sinh } \right)^{\left( 4 \right)} = \left( {\cosh x} \right)^\prime = \sinh x.\]

So, this yields

\[{y^{\left( 4 \right)}} = \left( {\begin{array}{*{20}{c}} 4\\ 0 \end{array}} \right)\sinh x \cdot x + \left( {\begin{array}{*{20}{c}} 4\\ 1 \end{array}} \right)\cosh x \cdot 1 = 1 \cdot \sinh x \cdot x + 4 \cdot \cosh x \cdot 1 = x\sinh x + 4\cosh x.\]

Example 6.

Find all derivatives of the function \[y = {e^x}{x^2}.\]

Solution.

Let \(u = {e^x}\) and \(v = {x^2}\). Then

\[u' = {\left( {{e^x}} \right)^\prime } = {e^x},\;\;\;v' = {\left( {{x^2}} \right)^\prime } = 2x,\;\;\;u^{\prime\prime} = {\left( {{e^x}} \right)^\prime } = {e^x},\;\;\;v^{\prime\prime} = {\left( {2x} \right)^\prime } = 2.\]

It is easy to find the general formulas for the derivatives of order \(n:\)

\[{u^{\left( n \right)}} = {e^x},\;\;\;v^{\prime\prime\prime} = {v^{IV}} = \ldots = {v^{\left( n \right)}} = 0.\]

Using the Leibniz formula

\[\left( {uv} \right)^{\left( n \right) = u^{\left( n \right)}}v + n{u^{\left( {n - 1} \right)}}v' + \frac{{n\left( {n - 1} \right)}}{{1 \cdot 2}}{u^{\left( {n - 2} \right)}}v^{\prime\prime} + \ldots + u{v^{\left( n \right)}}, \]

we obtain

\[{y^{\left( n \right)}} = {e^x}{x^2} + n{e^x} \cdot 2x + \frac{{n\left( {n - 1} \right)}}{{1 \cdot 2}}{e^x} \cdot 2\;\;\;\text{or}\;\;\;{y^{\left( n \right)}} = {e^x} \left[ {{x^2} + 2nx + n\left( {n - 1} \right)} \right].\]

See more problems on Page 2.

Page 1 Page 2