What is the n^(th) derivative of x^2e^x ?

Aug 11, 2017

$\frac{{d}^{n}}{{\mathrm{dx}}^{n}} {x}^{2} {e}^{x} = {y}^{\left(n\right)} \left(x\right)$
$\text{ } = \left({x}^{2} + 2 n x + n \left(n - 1\right)\right) {e}^{x}$

Explanation:

We have:

$y \left(x\right) = {x}^{2} {e}^{x}$ ..... [A]

Differentiating wrt $x$, and applying the product rule we get:

$y ' \setminus \setminus \setminus \setminus \setminus = {x}^{2} {e}^{x} + 2 x {e}^{x}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = \left({x}^{2} + 2 x\right) {e}^{x}$ ..... [B]

Differentiating again wrt $x$, and applying the product rule we get:

$y ' ' \setminus \setminus \setminus \setminus = \left({x}^{2} + 2 x\right) {e}^{x} + \left(2 x + 2\right) {e}^{x}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = \left({x}^{2} + 4 x + 2\right) {e}^{x}$

Differentiating again wrt $x$, and applying the product rule we get:

$y ' ' ' \setminus = \left({x}^{2} + 2 x\right) {e}^{x} + \left(2 x + 2\right) {e}^{x}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = \left({x}^{2} + 4 x + 2\right) {e}^{x} + \left(2 x + 4\right) {e}^{x}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = \left({x}^{2} + 6 x + 6\right) {e}^{x}$

Differentiating again wrt $x$, and applying the product rule we get:

${y}^{\left(4\right)} = \left({x}^{2} + 2 x\right) {e}^{x} + \left(2 x + 2\right) {e}^{x}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus = \left({x}^{2} + 6 x + 6\right) {e}^{x} + \left(2 x + 6\right) {e}^{x}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus = \left({x}^{2} + 8 x + 12\right) {e}^{x}$

Prediction

Based on the above results, it "appears" as if the ${n}^{t h}$ derivative is given by:

${y}^{\left(n\right)} = \left({x}^{2} + 2 n x + {n}^{2} - n\right) {e}^{x}$

So let us test this prediction using Mathematical Induction:

Induction Proof - Hypothesis

We aim to prove by Mathematical Induction that for $n \in \mathbb{N}$ that:

$\frac{{d}^{n}}{{\mathrm{dx}}^{n}} {x}^{2} {e}^{x} = {y}^{\left(n\right)} = \left({x}^{2} + 2 n x + {n}^{2} - n\right) {e}^{x}$
$\text{ } = \left({x}^{2} + 2 n x + n \left(n - 1\right)\right) {e}^{x}$ ..... [C]

Induction Proof - Base case:

We will show that the given result holds for:

$n = 0$ : (the function)
$n = 1$ : (the first derivative)

When $n = 0$ the given result gives:

${y}^{\left(0\right)} = \left({x}^{2}\right) {e}^{x} = y \left(x\right)$ (from [A])

When $n = 1$ the given result gives:

${y}^{\left(1\right)} = \left({x}^{2} + 2 x\right) {e}^{x} = y ' \left(x\right)$ (from [B])

So the given result is true when $n = 1$ (and in fact $n = 0$)

Induction Proof - General Case

Now, Let us assume that the given result [C] is true when $n = m$, for some $m \in \mathbb{N} , m > 1$, in which case for this particular value of $m$ we have:

$\frac{{d}^{m}}{{\mathrm{dx}}^{m}} {x}^{2} {e}^{x} = {y}^{\left(m\right)} = \left({x}^{2} + 2 m x + {m}^{2} - m\right) {e}^{x}$

So, differentiating the above, using the product rule, we get:

$\frac{{d}^{m + 1}}{{\mathrm{dx}}^{m + 1}} {x}^{2} {e}^{x} = \left({x}^{2} + 2 m x + {m}^{2} - m\right) {e}^{x} + \left(2 x + 2 m\right) {e}^{x}$
$\text{ } = \left({x}^{2} + 2 m x + 2 x + {m}^{2} - m + 2 m\right) {e}^{x}$
$\text{ } = \left({x}^{2} + 2 \left(\left(m + 1\right) x\right) + {m}^{2} + m\right) {e}^{x}$
$\text{ } = \left({x}^{2} + 2 \left(\left(m + 1\right) x\right) + \left(m + 1\right) \left(m\right)\right) {e}^{x}$

Which is the given result [C] with $n = m + 1$

Induction Proof - Summary

So, we have shown that if the given [C] result is true for $n = m$, then it is also true for $n = m + 1$. But we initially showed that the given result was true for $n = 0$ and $n = 1$ so it must also be true for $n = 2 , n = 3 , n = 4 , \ldots$ and so on.

Hence, by the process of mathematical induction the given result is true for $n \in \mathbb{N}$ QED