# Second-Order Taylor Approximation

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?

## 2 Answers

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

The first and second derivatives of the second-degree Taylor polynomial approximation at the point $(1,2)$ should be the same as the first and second derivatives of $f$ itself at that point.

Thus you have $\displaystyle \frac {\partial^2} {\partial h_1^2} \left( \frac 1 2 f_{xx} h_1^2 \right) = f_{xx}.$

So look at $\displaystyle \frac{\partial^2}{\partial h_2\,\partial h_1} (h_1 h_2 f_{xy}) = f_{xy}$ and ask why the factor $\dfrac 1 2$ should be there.