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)$$

$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)$
