MHB Taylor expansion of second order

Click For Summary
The discussion centers on finding the second-order Taylor expansion of two functions at the point (0,0). For the function f(x, y) = (x+y)^2, the expansion is confirmed to be correct, resulting in (h_1 + h_2)^2 with no remainder term. The second function, f(x, y) = e^{-x^2-y^2}cos(xy), also has its derivatives calculated, leading to a second-order expansion of 1 - h_1^2 - h_2^2, with a remainder term that approaches zero as h approaches zero. Some participants noted potential errors in the calculations of mixed partial derivatives, but overall, the expansions were validated. The conversation emphasizes the importance of accuracy in derivative calculations for Taylor expansions.
mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! :o

I have to find the Taylor expansion of second order of the following functions with center the given point $(x_0, y_0)$.

  1. $f(x, y)=(x+y)^2, x_0=0, y_0=0$
  2. $f(x, y)=e^{-x^2-y^2}\cos (xy), x_0=0, y_0=0$

I have done the following:

The Taylor expansion of second order of $f: \mathbb{R}^n \rightarrow \mathbb{R}$ is:

$$f(\overrightarrow{x_0}+\overrightarrow{h})=f(\overrightarrow{x_0})+\sum_{i=1}^{n}h_i \frac{\partial{f}}{\partial{x_i}}(\overrightarrow{x_0})+\frac{1}{2}\sum_{i,j=1}^{n}h_ih_j\frac{\partial^2{f}}{\partial{x_i}\partial{x_j}}(\overrightarrow{x_0})+R_2(\overrightarrow{h}, \overrightarrow{x_0})$$

where $\frac{R_2(\overrightarrow{h}, \overrightarrow{x_0})}{||\overrightarrow{h}||^2} \rightarrow 0$ when $\overrightarrow{h} \rightarrow \overrightarrow{0}$.

  1. $$f((x_0, y_0)+(h_1, h_2))=f(x_0, y_0)+h_1\frac{\partial{f}}{\partial{x}}(x_0, y_0)+h_2\frac{\partial{f}}{\partial{y}}(x_0, y_0)+\frac{1}{2}h_1^2\frac{\partial^2{f}}{\partial{x^2}}(x_0, y_0)+\frac{1}{2}h_1 h_2 \frac{\partial^2{f}}{\partial{x}\partial{y}}(x_0, y_0)+\frac{1}{2}h_2h_1\frac{\partial^2{f}}{\partial{y}\partial{x}}(x_0, y_0)+\frac{1}{2}h_2^2\frac{\partial^2{f}}{\partial{y^2}}(x_0, y_0)+R_2(\overline{h}, (x_0, y_0))$$

    We have:

    $$f(0, 0)=0 \\ \frac{\partial{f}}{\partial{x}}=2(x+y) \Rightarrow \frac{\partial{f}}{\partial{x}}(0,0)=0 \\ \frac{\partial{f}}{\partial{y}}=2(x+y) \Rightarrow \frac{\partial{f}}{\partial{y}}(0,0)=0 \\ \frac{\partial^2{f}}{\partial{x^2}}=2 \Rightarrow \frac{\partial^2{f}}{\partial{x^2}}(0,0)=2 \\ \frac{\partial^2{f}}{\partial{y^2}}=2 \Rightarrow \frac{\partial^2{f}}{\partial{y^2}}(0,0)=2 \\ \frac{\partial^2{f}}{\partial{x}\partial{y}}=2 \Rightarrow \frac{\partial^2{f}}{\partial{x}\partial{y}}(0,0)=2$$

    So $$f(h_1, h_2)=\frac{1}{2}h_1^22+h_1h_22+\frac{1}{2}h_2^22+R_2(\overrightarrow{h}, \overrightarrow{0})=h_1^2+2h_1h_2+h_2^2+R_2(\overrightarrow{h}, \overrightarrow{0})=(h_1+h_2)^2+R_2(\overrightarrow{h}, \overrightarrow{0})$$ Since $f(h_1, h_2)=f(h_1, h_2)+R_2(\overrightarrow{h}, \overrightarrow{0})$

    so $R_2(\overrightarrow{h}, \overrightarrow{0})=0$
  2. $$f((x_0, y_0)+(h_1, h_2))=f(x_0, y_0)+h_1\frac{\partial{f}}{\partial{x}}(x_0, y_0)+h_2\frac{\partial{f}}{\partial{y}}(x_0, y_0)+\frac{1}{2}h_1^2\frac{\partial^2{f}}{\partial{x^2}}(x_0, y_0)+\frac{1}{2}h_1 h_2 \frac{\partial^2{f}}{\partial{x}\partial{y}}(x_0, y_0)+\frac{1}{2}h_2h_1\frac{\partial^2{f}}{\partial{y}\partial{x}}(x_0, y_0)+\frac{1}{2}h_2^2\frac{\partial^2{f}}{\partial{y^2}}(x_0, y_0)+R_2(\overrightarrow{h}, (x_0, y_0))$$

    We have:

    $$f(0,0)=1 \\ \frac{\partial{f}}{\partial{x}}=e^{-x^2-y^2}(-2x\cos (xy)-y\sin (xy)) \Rightarrow \frac{\partial{f}}{\partial{x}}(0,0)=0 \\ \frac{\partial{f}}{\partial{y}}=e^{-x^2-y^2}(-2y\cos (xy)-x\sin (xy)) \Rightarrow \frac{\partial{f}}{\partial{y}}(0,0)=0 \\ \frac{\partial^2{f}}{\partial{x^2}}=e^{-x^2-y^2}((4x^2-y^2-2)\cos (xy)+4xy\sin (xy)) \Rightarrow \frac{\partial^2{f}}{\partial{x^2}}(0,0)=-2 \\ \frac{\partial^2{f}}{\partial{y^2}}=e^{-x^2-y^2}((-4y^2-xy-2)\cos (xy)+4 xy \sin (xy)) \Rightarrow \frac{\partial^2{f}}{\partial{y^2}}(0,0)=-2 \\ \frac{\partial^2{f}}{\partial{x}\partial{y}}=e^{-x^2-y^2}(3xy \cos(xy)+(2y^2+2xy-1)\sin (xy)) \Rightarrow \frac{\partial^2{f}}{\partial{x}\partial{y}}(0,0)=0$$

    So $$f(h_1, h_2)=1+\frac{1}{2}h_1^2(-2)+\frac{1}{2}h_2^2(-2)+R_2(\overrightarrow{h}, \overrightarrow{0})=1-h_1^2-h_2^2+R_2(\overrightarrow{h}, \overrightarrow{0})$$
    where $\frac{R_2(\overrightarrow{h}, \overrightarrow{0})}{||\overrightarrow{h}||^2} \rightarrow 0$ when $\overrightarrow{h} \rightarrow \overrightarrow{0}$.

Is this correct?? (Wondering) Could I improve something at the formulation?? (Wondering)
 
Last edited by a moderator:
Physics news on Phys.org
Hi! (Blush)

mathmari said:
  1. $f(x, y)=(x+y)^2, x_0=0, y_0=0$

You're expansion looks fine. (Nod)

You can do it a bit quicker though.
From the definition of $f$ we have:
$$f(x_0+h_1, y_0+h_2)=f(0+h_1, 0+h_2)=(h_1+h_2)^2=h_1^2 + 2h_1 h_2 + h_2^2$$
This is a 2nd order polynomial and as such it will be equal to the Taylor expansion with $R_2(\overrightarrow{h}, \overrightarrow{0})=0$. (Emo)
2. $f(x, y)=e^{-x^2-y^2}\cos (xy), x_0=0, y_0=0$

$$\frac{\partial{f}}{\partial{x}}=e^{-x^2-y^2}(-2x\cos (xy)-y\sin (xy)) \Rightarrow \frac{\partial{f}}{\partial{x}}(0,0)=0 \\ \frac{\partial{f}}{\partial{y}}=e^{-x^2-y^2}(-2y\cos (xy)-x\sin (xy)) \Rightarrow \frac{\partial{f}}{\partial{y}}(0,0)=0 \\ \frac{\partial^2{f}}{\partial{x^2}}=e^{-x^2-y^2}((4x^2-y^2-2)\cos (xy)+4xy\sin (xy)) \Rightarrow \frac{\partial^2{f}}{\partial{x^2}}(0,0)=-2 \\ \frac{\partial^2{f}}{\partial{y^2}}=e^{-x^2-y^2}((-4y^2-xy-2)\cos (xy)+4 xy \sin (xy)) \Rightarrow \frac{\partial^2{f}}{\partial{y^2}}(0,0)=-2 \\ \frac{\partial^2{f}}{\partial{x}\partial{y}}=e^{-x^2-y^2}(3xy \cos(xy)+(2y^2+2xy-1)\sin (xy)) \Rightarrow \frac{\partial^2{f}}{\partial{x}\partial{y}}(0,0)=0$$

I believe your calculations of $\frac{\partial^2{f}}{\partial{y^2}}$ and $\frac{\partial^2{f}}{\partial{x}\partial{y}}$ are not correct although the resulting values are correct. (Worried)

For the rest it looks fine to me. (Nod)