The theorem
Before you start: you need the standard \(n\)th derivatives from successive differentiation.
The product rule gives the first derivative of \(uv\). Differentiate again and again and the terms pile up, but they pile up in a pattern you have already seen in the binomial theorem.
If \(u\) and \(v\) have \(n\)th derivatives, then
\[(uv)_n = {}^nC_0\,u_n v + {}^nC_1\,u_{n-1}v_1 + {}^nC_2\,u_{n-2}v_2 + \cdots + {}^nC_n\,u\,v_n\]
Short form
\[(uv)_n = \sum_{r=0}^{n} {}^nC_r\;u_{n-r}\,v_r\]
The subscripts are orders of derivatives. They always add up to \(n\), just like the powers in \((a+b)^n\). The coefficients are \(1, n, \dfrac{n(n-1)}{2}, \ldots\), the same binomial coefficients.
Check small cases. For \(n = 1\) you get \(u_1v + uv_1\), the product rule. For \(n = 2\) you get \(u_2v + 2u_1v_1 + uv_2\).
Why it is true (induction)
Assume the formula for \(n\). Differentiate each term with the product rule: \({}^nC_r\,u_{n-r}v_r\) becomes \({}^nC_r\,(u_{n-r+1}v_r + u_{n-r}v_{r+1})\). Now collect every term containing \(u_{n+1-r}v_r\). Its coefficient is \({}^nC_r + {}^nC_{r-1}\), which equals \({}^{n+1}C_r\) by Pascal's rule. That is the formula for \(n+1\). \(\blacksquare\)
Choosing u and v
The formula is symmetric, but your working is not. Pick them like this:
- Make the polynomial \(v\). A polynomial of degree \(k\) has \(v_r = 0\) for every \(r > k\), so the sum stops after \(k+1\) terms.
- Make \(u\) the function whose \(n\)th derivative you know: \(e^{ax}\), \(\sin(ax+b)\), \(\log x\), \(\dfrac{1}{ax+b}\), and so on.
- Write \(u_n, u_{n-1}, u_{n-2}, \ldots\) from the standard formulas, and \(v, v_1, v_2, \ldots\) by plain differentiation.
- Substitute and simplify. Take out common factors.
For \(x^2e^{ax}\), the choice \(u = x^2\) would need \(u_n\), which is 0 for \(n \ge 3\), but then \(v = e^{ax}\) never runs out and you get all \(n+1\) terms. With \(v = x^2\) you get three.
The recurrence-type exam question
A favourite exam question gives a function like \(y = \sin(m\sin^{-1}x)\) and asks you to prove a relation between \(y_{n+2}\), \(y_{n+1}\) and \(y_n\). The script is always the same.
- Find \(y_1\) and clear the square root: get \(\sqrt{1-x^2}\,y_1\) on one side.
- Square and differentiate again. Divide by \(2y_1\). You reach an equation in \(y_2\), \(y_1\), \(y\).
- Differentiate that equation \(n\) times with Leibniz's theorem. Use the two expansions below.
- Collect the \(y_{n+2}\), \(y_{n+1}\) and \(y_n\) terms.
\[D^n\big[(1-x^2)\,y_2\big] = (1-x^2)\,y_{n+2} - 2nx\,y_{n+1} - n(n-1)\,y_n\]
\[D^n\big[x\,y_1\big] = x\,y_{n+1} + n\,y_n\]
In the first one, \(v = 1-x^2\) has \(v_1 = -2x\) and \(v_2 = -2\), and \({}^nC_2\cdot(-2) = -n(n-1)\). Once you have the recurrence, put \(x = 0\) to get \(y_n(0)\). Those values feed straight into Maclaurin series.
Solved examples
Example 1: A first one
EasyFind \(y_n\) if \(y = xe^x\).
- Take \(u = e^x\) and \(v = x\). Then \(u_k = e^x\) for every \(k\), \(v_1 = 1\), \(v_2 = 0\).
- \(y_n = u_n v + n\,u_{n-1}v_1 = xe^x + ne^x\).
Answer\(y_n = e^x(x + n)\)
Example 2: A quadratic times an exponential
EasyFind \(y_n\) if \(y = x^2e^{ax}\).
- Take \(u = e^{ax}\), \(v = x^2\). Then \(u_k = a^ke^{ax}\), \(v_1 = 2x\), \(v_2 = 2\), \(v_3 = 0\).
- \[y_n = a^ne^{ax}x^2 + n\,a^{n-1}e^{ax}(2x) + \frac{n(n-1)}{2}\,a^{n-2}e^{ax}(2)\]
- Take out \(a^{n-2}e^{ax}\).
Answer\(y_n = a^{n-2}e^{ax}\big[a^2x^2 + 2nax + n(n-1)\big]\)
Example 3: A specific order
MediumFind the 5th derivative of \(y = x^3\sin x\).
- Take \(u = \sin x\), \(v = x^3\). So \(v_1 = 3x^2\), \(v_2 = 6x\), \(v_3 = 6\), \(v_4 = 0\).
- \(u_k = \sin\left(x + \dfrac{k\pi}{2}\right)\): \(u_5 = \cos x\), \(u_4 = \sin x\), \(u_3 = -\cos x\), \(u_2 = -\sin x\).
- \(y_5 = u_5v + 5u_4v_1 + 10u_3v_2 + 10u_2v_3\).
- \[y_5 = x^3\cos x + 15x^2\sin x - 60x\cos x - 60\sin x\]
Answer\(y_5 = (x^3 - 60x)\cos x + (15x^2 - 60)\sin x\)
Example 4: A polynomial times a log
MediumFind \(y_n\) for \(y = x^2\log x\), where \(n \ge 3\).
- Take \(u = \log x\), \(v = x^2\). From the standard result, \(u_k = \dfrac{(-1)^{k-1}(k-1)!}{x^k}\).
- \(y_n = u_nx^2 + 2nx\,u_{n-1} + n(n-1)\,u_{n-2}\).
- Each term is a multiple of \(\dfrac{(-1)^{n-1}(n-3)!}{x^{n-2}}\). The multipliers are \((n-1)(n-2)\), \(-2n(n-2)\) and \(n(n-1)\).
- They add up to \(n^2 - 3n + 2 - 2n^2 + 4n + n^2 - n = 2\). Check \(n = 3\): \(y_1 = 2x\log x + x\), \(y_2 = 2\log x + 3\), \(y_3 = \dfrac{2}{x}\). ✓
Answer\(y_n = \dfrac{2(-1)^{n-1}(n-3)!}{x^{n-2}}\) for \(n \ge 3\)
Example 5: The classic
Exam levelIf \(y = \sin(m\sin^{-1}x)\), show that \((1-x^2)y_{n+2} - (2n+1)xy_{n+1} + (m^2 - n^2)y_n = 0\).
- \(y_1 = \cos(m\sin^{-1}x)\cdot\dfrac{m}{\sqrt{1-x^2}}\), so \(\sqrt{1-x^2}\,y_1 = m\cos(m\sin^{-1}x)\).
- Square: \((1-x^2)y_1^2 = m^2\big(1 - \sin^2(m\sin^{-1}x)\big) = m^2(1 - y^2)\).
- Differentiate: \((1-x^2)\,2y_1y_2 - 2xy_1^2 = -2m^2yy_1\). Divide by \(2y_1\): \((1-x^2)y_2 - xy_1 + m^2y = 0\).
- Differentiate \(n\) times using the two expansions: \[(1-x^2)y_{n+2} - 2nxy_{n+1} - n(n-1)y_n - xy_{n+1} - ny_n + m^2y_n = 0\]
- Collect: the \(y_{n+1}\) terms give \(-(2n+1)x\), and the \(y_n\) terms give \(m^2 - n^2 + n - n = m^2 - n^2\).
Answer\((1-x^2)y_{n+2} - (2n+1)xy_{n+1} + (m^2 - n^2)y_n = 0\)
Example 6: Values at zero
Exam levelFor \(y = \sin(m\sin^{-1}x)\), find \(y_n(0)\).
- Put \(x = 0\) in the result of Example 5: \(y_{n+2}(0) = (n^2 - m^2)\,y_n(0)\).
- Starting values: \(y(0) = \sin 0 = 0\) and \(y_1(0) = m\cos 0 = m\).
- Even orders: \(y_2(0) = (0 - m^2)\cdot 0 = 0\), and so every even one is 0.
- Odd orders: \(y_3(0) = (1 - m^2)m\), \(y_5(0) = (3^2 - m^2)(1 - m^2)m\), and so on.
Answer\(y_n(0) = 0\) for even \(n\); for odd \(n\), \(y_n(0) = m(1^2 - m^2)(3^2 - m^2)\cdots\big((n-2)^2 - m^2\big)\)
Example 7: An exponential version
Exam levelIf \(y = e^{m\sin^{-1}x}\), show that \((1-x^2)y_{n+2} - (2n+1)xy_{n+1} - (n^2 + m^2)y_n = 0\), and find \(y_n(0)\).
- \(y_1 = \dfrac{my}{\sqrt{1-x^2}}\), so \((1-x^2)y_1^2 = m^2y^2\).
- Differentiate and divide by \(2y_1\): \((1-x^2)y_2 - xy_1 - m^2y = 0\).
- Leibniz \(n\) times: \[(1-x^2)y_{n+2} - 2nxy_{n+1} - n(n-1)y_n - xy_{n+1} - ny_n - m^2y_n = 0\] This collects to the result.
- At \(x = 0\): \(y_{n+2}(0) = (n^2 + m^2)\,y_n(0)\), with \(y(0) = 1\) and \(y_1(0) = m\).
- So \(y_2(0) = m^2\), \(y_3(0) = m(1 + m^2)\), \(y_4(0) = m^2(2^2 + m^2)\).
AnswerEven \(n \ge 2\): \(y_n(0) = m^2(2^2 + m^2)\cdots\big((n-2)^2 + m^2\big)\). Odd \(n\): \(y_n(0) = m(1^2 + m^2)(3^2 + m^2)\cdots\big((n-2)^2 + m^2\big)\)
Example 8: A square of inverse sine
Exam levelIf \(y = (\sin^{-1}x)^2\), show that \((1-x^2)y_{n+2} - (2n+1)xy_{n+1} - n^2y_n = 0\) for \(n \ge 1\), and find \(y_n(0)\).
- \(y_1 = \dfrac{2\sin^{-1}x}{\sqrt{1-x^2}}\), so \((1-x^2)y_1^2 = 4(\sin^{-1}x)^2 = 4y\).
- Differentiate: \((1-x^2)2y_1y_2 - 2xy_1^2 = 4y_1\). Divide by \(2y_1\): \((1-x^2)y_2 - xy_1 = 2\).
- Differentiate \(n \ge 1\) times. The constant 2 becomes 0, and the left side collects to the result.
- At \(x = 0\): \(y(0) = 0\), \(y_1(0) = 0\), and the \(y_2\) equation gives \(y_2(0) = 2\). For \(n \ge 1\), \(y_{n+2}(0) = n^2\,y_n(0)\).
- So every odd one is 0, \(y_4(0) = 2^2\cdot 2 = 8\) and \(y_6(0) = 4^2\cdot 8 = 128\).
Answer\(y_n(0) = 0\) for odd \(n\); \(y_2(0) = 2\), \(y_4(0) = 8\), \(y_6(0) = 128\)
Learn the two expansions in Section 3 as a pair. Nearly every recurrence question reduces to \((1-x^2)y_2 - xy_1 + (\text{something})\,y = 0\), and once you can write its \(n\)th derivative without thinking, the whole question takes five lines.
Common mistakes
1. Making the polynomial \(u\)
For \(x^3\sin x\), taking \(u = x^3\) means \(v = \sin x\) is differentiated up to \(n\) times and nothing vanishes. Put the polynomial in \(v\), so \(v_4 = 0\) and you stop after four terms.
2. Losing the \(-n(n-1)y_n\) term
\(1 - x^2\) has a second derivative, \(-2\). So \(D^n[(1-x^2)y_2]\) has three terms, not two: \((1-x^2)y_{n+2} - 2nxy_{n+1} - n(n-1)y_n\). Leave out the last one and you get \(m^2\) instead of \(m^2 - n^2\).
3. Using the recurrence where it doesn't hold
For \(y = (\sin^{-1}x)^2\) the second-order equation is \((1-x^2)y_2 - xy_1 = 2\), not \(= 0\). The recurrence only holds for \(n \ge 1\), so get \(y_2(0) = 2\) from the \(y_2\) equation itself, not from the recurrence.
Practice questions
Try each one on paper before you open the answer.
Q1Find \(y_n\) if \(y = xe^{2x}\).
\(u = e^{2x}\), \(v = x\): \(y_n = 2^ne^{2x}x + n\,2^{n-1}e^{2x} = 2^{n-1}e^{2x}(2x + n)\).
Q2Find \(y_n\) if \(y = x^2\sin x\).
\(u = \sin x\), \(v = x^2\), \(v_1 = 2x\), \(v_2 = 2\):
\[y_n = x^2\sin\left(x + \frac{n\pi}{2}\right) + 2nx\sin\left(x + \frac{(n-1)\pi}{2}\right) + n(n-1)\sin\left(x + \frac{(n-2)\pi}{2}\right)\]
Q3Find the 4th derivative of \(x^3e^x\).
Coefficients \(1, 4, 6, 4\) with \(v = x^3, 3x^2, 6x, 6\): \(e^x(x^3 + 12x^2 + 36x + 24)\).
Q4Find \(y_n\) if \(y = x\log x\), for \(n \ge 2\).
\(y_n = x\,u_n + n\,u_{n-1}\) with \(u = \log x\). This is \(\dfrac{(-1)^{n-2}(n-2)!}{x^{n-1}}\big[-(n-1) + n\big]\).
So \(y_n = \dfrac{(-1)^n(n-2)!}{x^{n-1}}\). Check \(n = 2\): \(y_2 = \dfrac{1}{x}\). ✓
Q5If \(y = \cos(m\sin^{-1}x)\), show that \((1-x^2)y_{n+2} - (2n+1)xy_{n+1} + (m^2 - n^2)y_n = 0\).
\(\sqrt{1-x^2}\,y_1 = -m\sin(m\sin^{-1}x)\), so \((1-x^2)y_1^2 = m^2(1 - y^2)\), the same equation as for \(\sin(m\sin^{-1}x)\).
So \((1-x^2)y_2 - xy_1 + m^2y = 0\), and Leibniz gives the same recurrence.
Q6If \(y = \sin^{-1}x\), show that \((1-x^2)y_{n+2} - (2n+1)xy_{n+1} - n^2y_n = 0\) and find \(y_5(0)\).
\(\sqrt{1-x^2}\,y_1 = 1\). Differentiate: \((1-x^2)y_2 - xy_1 = 0\). Leibniz \(n\) times gives the result.
At \(x = 0\): \(y_{n+2}(0) = n^2y_n(0)\), \(y_1(0) = 1\). So \(y_3(0) = 1\) and \(y_5(0) = 9\).
Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.
Frequently asked questions
What is Leibniz's theorem?
A formula for the \(n\)th derivative of a product: \((uv)_n = \sum_{r=0}^{n} {}^nC_r\,u_{n-r}v_r\). It is the product rule applied \(n\) times, with binomial coefficients.
When should I use Leibniz's theorem?
When you need \(y_n\) for a product that can't be turned into a sum, such as \(x^2e^x\) or \(x^3\log x\). It is also the tool for the \(y_{n+2}\), \(y_{n+1}\), \(y_n\) recurrence questions.
Which function should be u and which v?
Make the polynomial \(v\), so its derivatives become 0 and the sum stops. Make \(u\) the function whose \(n\)th derivative you already know.
How do I find the nth derivative at x = 0?
Prove the recurrence, put \(x = 0\) to get \(y_{n+2}(0)\) in terms of \(y_n(0)\), then start from \(y(0)\) and \(y_1(0)\) and step up two orders at a time.