# How do you find the first and second derivative of ln((x^2)(e^x))?

##### 1 Answer
Oct 30, 2016

$\left(\ln \left({x}^{2} {e}^{x}\right)\right) ' = \frac{2 + x}{x}$

$\left(\ln \left({x}^{2} {e}^{x}\right)\right) ' ' = - \frac{2}{x} ^ 2$

#### Explanation:

The derivative of the given function is determined by using chain rule and applying some differential properties of the function $\ln x$ and the product functions.

Let $f \left(x\right) = \ln x \mathmr{and} g \left(x\right) = \left({x}^{2}\right) \left({e}^{x}\right)$

Then $f o g \left(x\right) = f \left(g \left(x\right)\right) = \ln \left(\left({x}^{2}\right) \left({e}^{x}\right)\right)$

Derivative of a composite function
$\textcolor{red}{\left(f o g \left(x\right)\right) ' = f ' \left(g \left(x\right)\right) \times g ' \left(x\right)}$

Let us compute $f ' \left(g \left(x\right)\right) \mathmr{and} g ' \left(x\right)$

$f \left(x\right) = \ln x$
$f ' \left(x\right) = \frac{1}{x}$

$f ' \left(g \left(x\right)\right) = \frac{1}{g \left(x\right)}$

$\textcolor{red}{f ' \left(g \left(x\right)\right) = \frac{1}{{x}^{2} {e}^{x}}}$

$g \left(x\right)$ is a product of two functions ${x}^{2}$ and ${e}^{x}$

The product rule of differentiation:
$\textcolor{g r e e n}{u ' v + v ' u}$

$g ' \left(x\right) = \textcolor{g r e e n}{\left({x}^{2}\right) ' {e}^{x} + {x}^{2} \left({e}^{x}\right) '}$
$g ' \left(x\right) = 2 x {e}^{x} + {x}^{2} {e}^{x}$
color(red)(g'(x)=xe^x(2+x)

$\textcolor{red}{\left(f o g \left(x\right)\right) ' = f ' \left(g \left(x\right)\right) \times g ' \left(x\right)}$
$\left(\ln \left({x}^{2} {e}^{x}\right)\right) ' = \frac{1}{{x}^{2} {e}^{x}} \times x {e}^{x} \left(2 + x\right)$
$\left(\ln \left({x}^{2} {e}^{x}\right)\right) ' = \frac{\cancel{x {e}^{x}} \left(2 + x\right)}{\cancel{{x}^{2} {e}^{x}}}$
$\left(\ln \left({x}^{2} {e}^{x}\right)\right) ' = \frac{2 + x}{x}$

Let us compute the second derivative by applying quotient rule:

$\left(\ln \left({x}^{2} {e}^{x}\right)\right) ' '$

#=((ln(x^2e^x))')'

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

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

$= \frac{x - x - 2}{x} ^ 2$

$= - \frac{2}{x} ^ 2$