[Math] Second-Order Taylor Approximation

multivariable-calculuspartial derivativetaylor expansion

Let $f(x, y) = x \cos(πy) − y \sin(πx)$

Find the second-order Taylor approximation for $f$ at the point $(1, 2)$.

I believe the formula for 2nd order Taylor approx can be simplified to

$$f(a+h_1,b+h_2) = f(a,b) + f_x(a,b)h_1 + f_y(a,b)h_2 + \frac{1}{2}(h_1^2f_{xx}+h_1h_2f_{xy}+h_1h_2f_{yx}+h_2^2f_{yy})$$

where $h_1 = x-a$ and $h_2= y-b$

My answer (INCORRECT):
$$g(x,y) =2+2\pi +\frac{1}{2}\left(\pi \left(y-2\right)\left(x-1\right)+\left(x-1\right)\left(y-2\right)\pi -\left(y-2\right)^2\pi ^2\right)$$

What am I missing?

Best Answer

We have $f(1,2)=1$. So

$$f(x,y)\approx f(1,2)+f_x(1,2)(x-1)+f_y(1,2)(y-2)+\text{second order terms}$$

But $f_x=\cos\pi y-\pi y\cos\pi x$ and $f_y=-\pi x\sin(\pi y)-\sin(\pi x)$.

Hence $f_x(1,2)=1+2\pi$ and $f_y(1,2)=0$.

So

$$f(x,y)\approx 1 + (1+2\pi)(x-1)+\text{second order terms}$$