[Math] Taylor expansion of $x^2ye^{1-xy}$ at the point $(1,1)$

analysiscalculusmultivariable-calculusreal-analysistaylor expansion

I'm asked to find the second order Taylor expansion of $x^2ye^{1-xy}$ at the point $(1,1)$. I would like that you check my work, thank you.

So first I took all needed derivatives :
$$f_x=2xye^{1-xy}+x^2ye^{1-xy}(-y)=e^{1-xy}(2xy-x^2y^2)$$
$$f_y=x^2e^{1-xy}+x^2ye^{1-xy}(-x)=e^{1-xy}(x^2-x^3y)$$
$$f_{xx}=(-y)e^{1-xy}(2xy-x^2y^2)+e^{1-xy}(2y-2xy^2)=e^{1-xy}(x^2y^3-4xy^2+2y)$$
$$f_{yy}=(-x)e^{1-xy}(x^2-x^3y)+e^{1-xy}(-x^3)=e^{1-xy}(x^4y-2x^3)$$
$$f_{xy}=f_{yx}=(-x)e^{1-xy}(2xy-x^2y^2)+e^{1-xy}(2x-2x^2y)=e^{1-xy}(x^3y^2-4x^2y+2x)$$

and $f(1,1)=1, f_x(1,1)=1, f_y(1,1)=0, f_{xx}(1,1)=-1, f_{yy}(1,1)=-1, f_{xy}(1,1)=f_{yx}(1,1)=-1$

So now, I plug everything into the formula:
$$f(1,1)+f_x(1,1)(x-1)+f_y(1,1)+\frac{1}{2!}[f_{xx}(1,1)(x-1)^2+2f_{xy}(x-1)(y-1)+f_{yy}(1,1)(y-1)^2]$$
$$=1+(x-1)+\frac{1}{2!}[-(x-1)^2-2(x-1)(y-1)-(y-1)^2]$$

And I think that this should be the answer, do you agree with that ? Or did I forgot something/ made a mistake somewhere ? I checked the derivatives in WolframAlpha but still, I would like your feedback to be sure.

Thanks for your help !

Best Answer

One can also use formal algebraic operations with taylor polynomials taken modulo the ideal generated by monomials of degree $3$ in the factors $s=(x-1)$ and $t=(y-1)$. I will denote this ideal by $\mathcal O$. Instead of the longer $\mathcal O(s^3,s^2t, st^2, t^3)$.

Then: $$ \begin{aligned} &x^2y\exp(1-xy) +\mathcal O \\ %&= %((x-1)+1)^2((y-1)+1)\exp(1-((x-1)+1)((y-1)+1)) %+\mathcal O %\\ &=(1+s)^2(1+t)\exp(1-(1+s)(1+t)) +\mathcal O \\ &=(1+s)^2(1+t)\exp(-s-t-st) +\mathcal O \\ &=(1+t+2s+2st+s^2)\left(1-\frac 1{1!}(s+t+st)+\frac 1{2!}(s+t)^2\right) +\mathcal O \\ &=(1+t+2s+2st+s^2) -(1+t+2s)\frac 1{1!}(s+t+st) +1\cdot\frac 1{2!}(s+t)^2 +\mathcal O \\ &=(1+t+2s+2st+s^2) \\ &\qquad-(s+st+2s^2)-(t+t^2+2st)-st \\ &\qquad\qquad+\frac 1{2!}(s^2+2st+t^2) +\mathcal O \\ &= 1+s-\frac 12s^2-st-\frac 12t^2+\mathcal O\ . \end{aligned} $$ All computations were included. (Many copy+paste issues.) Computer check:

sage: var('x,y,s,t');
sage: taylor( (1+s)^2 * (1+t) * exp(1-(1+s)*(1+t)), (s,0), (t,0), 2 )
-1/2*s^2 - s*t - 1/2*t^2 + s + 1
sage: taylor( x^2 * y * exp( 1-x*y ), (x,1), (y,1), 2 )
-1/2*(x - 1)^2 - (x - 1)*(y - 1) - 1/2*(y - 1)^2 + x

(The $s,t$-version is better, for some reason, sage wanted to simplify the $(x-1)+1$, corresponding to $s+1$, and printed that $x$. Else, everything is the same. Well, the order of the terms is not the one we want, but...)