\section{Taylor Polynomials}
\begin{enumerate}[1.]
\item {\it 
Find the second order Taylor polynomial of the function 
$f(x,y)=\sin(x+y^2)$ at $(\pi,0)$.}


We calculate the necessary derivatives:

$$f(\pi,0)=\sin\pi=0,$$
$$f_x(x,y)=\cos(x+y^2), \ f_x(\pi,0)=\cos\pi=-1,$$
$$f_y(x,y)=2y\cos(x+y^2), \ f_y(\pi,0)=0,$$
$$f_{xx}(x,y)=-\sin(x+y^2), \ f_{xx}(\pi,0)=-\sin\pi=0,$$
$$f_{xy}(x,y)=-2y\sin(x+y^2), \ f_{xy}(\pi,0)=0,$$
$$f_{yy}(x,y)=-4y^2\sin(x+y^2)+2\cos(x+y^2), \ f_{yy}(\pi,0)=2\cos\pi=-2.$$
Therefore $p_2(x,y)=-(x-\pi)-y^2.$

\bigskip


\item {\it
Suppose that the function $f(x,y)$ and all its partial derivatives are continuous for all
$x,y$, and that its second order Taylor polynomial  
at $(a,b)$ is 
$$
p_2(x,y) = -7 + 4(x-a) -13(x-a)^2 - 6 (x-a)(y-b) + 10(y-b)^2.
$$
Find the partial derivatives $f_1(a,b)$, $f_{11}(a,b)$, and $f_{12}(a,b)$.}


\medskip
We can just read the derivatives from the given formula:
$f_1(a,b)=4$, $f_{11}(a,b)=-26$, and $f_{12}(a,b)=-6$.


\bigskip

\item {\it Let $f(x,y)=Ax^2+Bxy+Cy^2$ for some constants $A,B,C$. Prove that the second order Taylor polynomial
of $f(x,y)$ at every point $(a,b)$ in the $xy$-plane is equal to $f(x,y)$.}

\bigskip

We have 
$$
f_1(x,y)=2Ax+By,\ f_2(x,y)=Bx+2Cy,
$$
$$
f_{11}(x,y)=2A,\ f_{12}(x,y)=f_{21}(x,y)=B,\ f_{22}(x,y)=2C.
$$
Thus at $(a,b)$ the second order Taylor polynomial is
\begin{align*}
p_2(x,y)&=(Aa^2+Bab+Cb^2)+(2Aa+Bb)(x-a)+(2Cb+Ba)(y-b)
\\
&\ \ +A(x-a)^2+B(x-a)(y-b)+C(y-b)^2
\\
&=Aa^2+Bab+Cb^2+2Aax+Bbx-2Aa^2-Bab 
\\
&\ \ + 2Cby+Bay - 2Cb^2 - Bab + Ax^2-2Aax + Aa^2 \\
&\ \ + Bxy - Bay - Bbx + Bab + Cy^2 - 2Cby + Cb^2
\\
&=Ax^2+Bxy+Cy^2.
\end{align*}

\bigskip

\item {\it 
Let $F(x,y)=xf(x+y)+y g(x+y)$, where $f,g$ are real-valued functions of one variable whose all
derivatives are continuous.

\medskip
(a) Prove that $F(x,y)$ satisfies the equation $F_{xx}(x,y)-2F_{xy}(x,y)+F_{yy}(x,y)=0$
for all $x,y$.}

\bigskip

We calculate the derivatives:
$$F_x(x,y)=f(x+y)+xf'(x+y)+yg'(x+y)$$
$$F_y(x,y)=xf'(x+y)+g(x+y)+yg'(x+y)$$
$$F_{xx}(x,y)=xf''(x+y)+2f'(x+y)+yg''(x+y)$$
$$F_{xy}(x,y)=f'(x+y)+xf''(x+y)+g'(x+y)+yg''(x+y)$$
$$F_{yy}(x,y)=xf''(x+y)+2g'(x+y)+yg''(x+y)$$
so that, with all derivatives evaluated at $x+y$,
\begin{align*}
&F_{xx}-2F_{xy}+F_{yy}
\\
&=(xf''+2f'+yg'')+(xf''+2g+yg'')-2 (f'+xf''+g'+yg'')
\\
&=0.
\end{align*}

\bigskip


{\it (b)
Find the second order Taylor polynomial of $F$ at the point $(0,0)$ in terms of the
derivatives of $f,g$ at 0.}

\medskip

At $(0,0)$, we have $F(0,0)=0$ and
$$F_x(0,0)=f(0),\ \ F_y(0,0)=g(0),$$
$$F_{xx}(0,0)=2f'(0),\ \ F_{xy}(0,0)=f'(0)+g'(0),\ \ 
F_{yy}(0,0)=2g'(0)$$
Thus
$$
p_2(x,y)=f(0)x+g(0)y+f'(0)x^2 +(f'(0)+g'(0))xy + g'(0) y^2$$






\item
{\it Let }
$$f(x,y)=\left\{\begin{matrix}
\displaystyle{\frac{x^4}{x^2+y^2}}&\hbox{ if }(x,y)\neq (0,0)\\
0&\hbox{ if }(x,y)=(0,0)\\
\end{matrix}
\right.
$$

\medskip

 {\it (a) Compute $f_1,f_2,f_{11},f_{12}, f_{21}, f_{22}$ at $(0,0)$. Be careful and make sure to use the
definition of the derivative where necessary. As an intermediate step, it may also be necessary to find the general expressions for some of these partials at points other than $(0,0)$.}

\medskip

\begin{itemize}

\item We have $f(x,0)=x^4/x^2=x^2$ for $x\neq 0$, and this is also consistent with $f(0,0)=0$, so that $f(x,0)=0$ for all $x$.
Therefore 
$$f_1(x,0)=2x,\ \ f_{11}(x,0)=2,
$$
 so that $f_1(0,0)=0$, $f_{11}(0,0)=2$.

\medskip

\item Similarly, $f(0,y)=0$ for all $y$ including $y=0$.
Therefore 
$$
f_2(0,y)=0\ \ f_{22}(0,y)=0,
$$
 so that $f_2(0,0)=0$, $f_{22}(0,0)=0$.

\medskip


\item To compute $f_{12}(0,0)$ and $f_{21}(0,0)$, we need to do more work. We have
$$
f_{12}(0,0)=\lim_{y\to 0}\frac{f_1(0,y)-f_1(0,0)}{y},\ \ 
f_{21}(0,0)=\lim_{x\to 0}\frac{f_2(x,0)-f_2(0,0)}{x}.
$$
To evaluate these, we have to compute $f_1(0,y)$ and $f_2(x,0)$ first. At $(x,y)\neq (0,0)$, we have
$$
f_{1}(x,y)=\frac{4x^3(x^2+y^2)-x^4\cdot 2x}{(x^2+y^2)^2},\ \ f_1(0,y)=0,
$$
$$
f_{2}(x,y)=\frac{-x^4\cdot 2y}{(x^2+y^2)^2},\ \ f_2(x,0)=0,
$$
Therefore $f_{12}(0,0)= f_{21}(0,0) =0$.

\end{itemize}

\medskip


{\it (b) Based on your answer from (a), write the second order Taylor polynomial $p_2(x,y)$ for
$f(x,y)$ at $(0,0)$. Is it true that 
$$\lim_{(x,y)\to (0,0)} \frac{f(x,y)-p_2(x,y)}{x^2+y^2}=0?
$$
 Prove your answer.}

\medskip

Based on the above, $p_2(x,y)=x^2$, We have 
\begin{align*}
\lim_{(x,y)\to (0,0)} \frac{f(x,y)-p_2(x,y)}{x^2+y^2}
&
= \lim_{(x,y)\to (0,0)}  \frac{x^4- x^2(x^2+y^2)}{(x^2+y^2)^2}
\\
&= \lim_{(x,y)\to (0,0)}  \frac{-x^2y^2}{(x^2+y^2)^2}.
\end{align*}
This limit does not exist. To see this, let $g(x,y)=\displaystyle{ \frac{-x^2y^2}{(x^2+y^2)^2}}$. If 
$x=0$ and $y\to 0$, then $g(0,y)=0\to 0$. If on the other hand $x=y$, then 
$g(x,x)=\frac{-x^4}{4x^4}=\frac{-1}{4}\to -\frac{1}{4}$ as $x\to 0$. In particular, it is not true that the limit is 0.

\end{enumerate}
