# What are the first and second derivatives of f(x)=ln(e^-x + xe^-x) ?

Nov 16, 2015

$f ' \left(x\right) = - 1 + \frac{1}{1 + x}$
$f ' ' \left(x\right) = - \frac{1}{1 + x} ^ 2$

#### Explanation:

In this case, you could build the derivative immediately using the chain rule.
However, it is much easier if you simplify the function beforehand.

Let me break it down to you. :)

First, you can factor ${e}^{- x}$ in the argument of the $\log$ expression:

$\ln \left({e}^{- x} + x {e}^{- x}\right) = \ln \left({e}^{- x} \left(1 + x\right)\right)$

Now, you can use the logarithm rule ${\log}_{a} \left(x \cdot y\right) = {\log}_{a} \left(x\right) + {\log}_{a} \left(y\right)$ leading to:

$\ln \left({e}^{- x} + x {e}^{- x}\right) = \ln \left({e}^{- x} \left(1 + x\right)\right) = \ln \left({e}^{- x}\right) + \ln \left(1 + x\right)$

As next, please remember that $\ln \left(x\right)$ and ${e}^{x}$ are inverse functions, so $\ln \left({e}^{x}\right) = x$ and ${e}^{\ln} \left(x\right) = x$ holds. With this knowledge, we can simplify further:

$\ln \left({e}^{- x} + x {e}^{- x}\right) = \ln \left({e}^{- x} \left(1 + x\right)\right) = \ln \left({e}^{- x}\right) + \ln \left(1 + x\right) = - x + \ln \left(1 + x\right)$

This means that our function can be simplified in:

$f \left(x\right) = - x + \ln \left(1 + x\right)$

Now we can compute the derivatives. :)

$f ' \left(x\right) = - 1 + \frac{1}{1 + x} = - 1 + {\left(1 + x\right)}^{- 1}$

$f ' ' \left(x\right) = - \frac{1}{1 + x} ^ 2 = - {\left(1 + x\right)}^{- 2}$

Hope that this helped!