Math Help - Taylor series of erf

1. Taylor series of erf

Hi,

When I use substitution to find the power series of e^(-x^2) at x=0, I get 1-x^2+x^4/2!-x^6/3!+...

However, when I take the derivative of e^(-x^2) directly, I get: 1-2x^2+12x^4/2!-...

Can anyone tell me why this is the case? Did I do the derivative wrong?

2. Re: Taylor series of erf

y(x) = e^(-x^2) = 1-x^2+x^4/2!-x^6/3!+...
y' = ?
First method :
y' = (1-x^2+x^4/2!-x^6/3!+...)' = -2x+4x^3/2!-6x^5/3!+...
y' = -2x+2x^3-x^5+...
Second method :
y' = -2x e^(-x^2)
y' = -2x (1-x^2+x^4/2!-x^6/3!+...)
y' = -2x+2x^3-2x^5/2!+2x^7/3!+...
y' = -2x+2x^3-x^5+...
Both methods lead to the same result.