Derivative of $-2e^{-x^2}x$ $$f(x) = -2e^{-x^2}x$$
Find $f'(x)$:
I have making a small  mistake some where in my calculation and I cannot find it.
The answer is stated as:
$$e^{-x^2}(4x^2-2)$$
However I got something different from my work:
$$f'(x)=-2[(e^{-x^2})'(x)+(e^{-x^2})(x)']$$
$$=-2[(e^{-x^2})(-2x)+e^{-x^2}]$$
$$=-2[-2xe^{-x^2}+e^{-x^2}]$$
$$=4xe^{-x^2}-2e^{-x^2}$$
$$=e^{-x^2}(4x-2)$$
 A: (1) $f(x)=-2e^{-x^2}x$ (apply product rule)
(2) $-2 (e^{-x^2}(1)+x(e^{-x^2})\frac{d}{dx}(-x^2)$)
(3) $-2(e^{-x^2}-2x^2e^{-x^2})$  
(4) $-2e^{-x^2}+4x^2e^{-x^2}$
(5) $e^{-x^2}(4x^2-2)$
A: $f(x) = -2e^{-x^2}x$ let $h(x)=-2e^{-x^2}$ and let $g(x)=x$.
since $f(x)=h(x)*g(x)$ we know (using the product rule that $f'(x)=h'(x)*g(x)+g'(x)h(x)$.
now let $h_1(x)=-x^2$ and $h_2(x)=-2e^x$ Then $h_2(h_1(x)=h(x)$
then using the chain rule $h'(x)=h_2'(h_1(x))*h_1'(x)$.
Putting this all together we get $f'(x)=g'x*h(x)+(h_2'(h_1(x))*h_1'(x))g(x)$
which is just $1*-2e^{-x^2}+(-2e^-x^2)*(-2x)*(x)=e^{-x^2}(4x^2 -2)$
A: The Product Rule: If $f$ and $g$ are both differentiable, then $${d\over dx}(f(x)g(x))=f(x){d\over dx}(g(x))+g(x){d\over dx}(f(x)).$$ Consider $$f(x)=-2x\cdot e^{-x^2}.$$ Using the product rule we see that $$f'(x)=-2x\cdot{d\over dx}(e^{-x^2})+e^{-x^2}\cdot{d\over dx}(-2x).$$ We know that ${d\over dx}(e^{-x^2})=-2xe^{-x^2}$ by the Chain Rule and ${d\over dx}(-2x)=-2$ by the Power Rule. This gives us $$f'(x)=-2x\cdot-2xe^{-x^2}+e^{-x^2}\cdot(-2)$$ and combining everything we obtain $$f'(x)=4x^2e^{-x^2}-2e^{-x^2}=e^{-x^2}(4x^2-2).$$ 
