# How do you find the 1st and 2nd derivative of y=x^2e^(x^2)?

Nov 5, 2016

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 x {e}^{{x}^{2}} \left(1 + {x}^{2}\right)$ and $\frac{{d}^{2} y}{\mathrm{dx}} ^ 2 = 2 {e}^{{x}^{2}} \left(2 {x}^{4} + 5 {x}^{2} + 1\right)$

#### Explanation:

We start by finding the first derivative through the product rule, which says that $\frac{d}{\mathrm{dx}} \left(u v\right) = \frac{\mathrm{du}}{\mathrm{dx}} \cdot v + u \cdot \frac{\mathrm{dv}}{\mathrm{dx}}$. Thus:

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

We see that:

• $\frac{d}{\mathrm{dx}} {x}^{2} = 2 x$
• $\frac{d}{\mathrm{dx}} {e}^{{x}^{2}} = {e}^{{x}^{2}} \left(\frac{d}{\mathrm{dx}} {x}^{2}\right) = {e}^{{x}^{2}} \left(2 x\right)$

Note that you need to use the chain rule for the derivative of ${e}^{{x}^{2}}$. We need to remember that $\frac{d}{\mathrm{dx}} {e}^{x} = {e}^{x}$, so $\frac{d}{\mathrm{dx}} {e}^{u} = {e}^{u} \cdot \frac{\mathrm{du}}{\mathrm{dx}}$.

Returning to the derivative:

$\frac{\mathrm{dy}}{\mathrm{dx}} = \left(2 x\right) {e}^{{x}^{2}} + {x}^{2} \left({e}^{{x}^{2}}\right) \left(2 x\right)$

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 x {e}^{{x}^{2}} + 2 {x}^{3} {e}^{{x}^{2}}$

$\frac{\mathrm{dy}}{\mathrm{dx}} = 2 {e}^{{x}^{2}} \left(x + {x}^{3}\right)$

Note that we can also write that $\frac{\mathrm{dy}}{\mathrm{dx}} = 2 x {e}^{{x}^{2}} \left(1 + {x}^{2}\right)$ but this will make differentiating more difficult.

Now to find the second derivative, use the product rule again!

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

We already know that $\frac{d}{\mathrm{dx}} {e}^{{x}^{2}} = {e}^{{x}^{2}} \left(2 x\right)$. Through the product rule, $\frac{d}{\mathrm{dx}} \left(x + {x}^{3}\right) = 1 + 3 {x}^{2}$. So:

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

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

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

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