# If g(x)=x/(e^x), what is g^(n) (x)?

Nov 1, 2016

${g}^{\left(n\right)} \left(x\right) = {\left(- 1\right)}^{n} {e}^{-} x \left(x - n\right)$

#### Explanation:

Rewrite as $g \left(x\right) = x {e}^{-} x$

We can then use the product rule; $\frac{d}{\mathrm{dx}} \left(u v\right) = u \frac{\mathrm{dv}}{\mathrm{dx}} + v \frac{\mathrm{du}}{\mathrm{dx}}$

$g ' \left(x\right) = \left\{\left(x\right) \left(\frac{d}{\mathrm{dx}} {e}^{-} x\right) + \left({e}^{-} x\right) \left(\frac{d}{\mathrm{dx}} x\right)\right\}$
$\therefore g ' \left(x\right) = \left\{\left(x\right) \left(- {e}^{-} x\right) + \left({e}^{-} x\right) \left(1\right)\right\}$
$\therefore g ' \left(x\right) = {e}^{-} x - x {e}^{-} x$

We can now write down the second derivative:
$g ' ' \left(x\right) = - {e}^{-} x - \left({e}^{-} x - x {e}^{-} x\right)$
$\therefore g ' ' \left(x\right) = - 2 {e}^{-} x + x {e}^{-} x$

Similarly the third derivative:
${g}^{\left(3\right)} \left(x\right) = 2 {e}^{-} x + {e}^{-} x - x {e}^{-} x$
$\therefore {g}^{\left(3\right)} \left(x\right) = 3 {e}^{-} x - x {e}^{-} x$

So it looks like clear pattern is forming, but let us just check by looking at the fourth derivative;
$: {g}^{\left(4\right)} \left(x\right) = - 3 {e}^{-} x - \left({e}^{-} x - x {e}^{-} x\right)$
$\therefore {g}^{\left(4\right)} \left(x\right) = - 4 {e}^{-} x + x {e}^{-} x$

In summary;
${g}^{\left(0\right)} \left(x\right) = - 0 {e}^{-} x + x {e}^{-} x$
${g}^{\left(1\right)} \left(x\right) = + {e}^{-} x - x {e}^{-} x$
${g}^{\left(2\right)} \left(x\right) = - 2 {e}^{-} x + x {e}^{-} x$
${g}^{\left(3\right)} \left(x\right) = + 3 {e}^{-} x - x {e}^{-} x$
${g}^{\left(4\right)} \left(x\right) = - 4 {e}^{-} x + x {e}^{-} x$

And this would lead s to conclude that
${g}^{\left(n\right)} \left(x\right) = - {\left(- 1\right)}^{n} \left(n\right) {e}^{-} x + {\left(- 1\right)}^{n} x {e}^{-} x$
$\therefore {g}^{\left(n\right)} \left(x\right) = {\left(- 1\right)}^{n} {e}^{-} x \left(x - n\right)$

NOTE:
This is NOT a vigorous proof! In order to prove this result is valid we would need to start with the result and use proof by Induction.

Nov 1, 2016

${g}^{\left(n\right)} \left(x\right) = {\left(- 1\right)}^{n} \left(g \left(x\right) - n x\right) , n = 1 , 2 , 3 , \ldots$

#### Explanation:

$= x {e}^{- x}$

$g ' = - x {e}^{- x} + {e}^{- x} = - g + {e}^{- x}$

$g ' ' = - g ' - {e}^{- x} = g + 2 {e}^{- x}$

And so, ${g}^{\left(3\right)} = - g - 3 {e}^{- x}$, and so on.

Thus, ${g}^{\left(n\right)} = {\left(- 1\right)}^{n} \left(g - n {e}^{- x}\right) , n = 1 , 2 , 3 , .$..