# Find Taylor expansion term for a function at given [MATH]n[/MATH] and [MATH]k[/MATH].

#### Zappa

##### New member
Here is the function:

$$\displaystyle (x,y)=e^{xy}sin(x^2y), \ \ M=\left[\begin{matrix}1 \\ \pi \end{matrix}\right], n=4, k=3$$

$$\displaystyle f(x,y)= {\Sigma_{n=0}^{\infty}} \left[ \left(\begin{matrix} n \\ k \end{matrix}\right)\left. \frac{\partial f}{ \partial x^{n-k}\partial y^k }\right\vert_{M} (x-x_0)^{n-k}(y-y_0)^k \right]$$

My solution (I may have understood it incorrectly, so if you could be pinpoint where have I misunderstood, I would be grateful.):

$$\displaystyle f_x=ye^{xy}sin(x^2y) + 2xe^{xy}cos(x^2y)$$

$$\displaystyle f_{xy}=e^{xy}sin(x^2y)+xye^{xy}sin(x^2y)+ x^2ye^{xy}cos(x^2y)+2x^2e^{xy}cos(x^2y)-2x^3e^{xy}sin(x^2y)$$

$$\displaystyle f_{xyy}=xe^{xy}sin(x^2y)+x^2e^{xy}cos(x^2y)+xe^{xy}sin(x^2y)+x^2ye^{xy}sin(x^2y)+x^3ye^{xy}cos(x^2y)+x^2e^{xy}cos(x^2y)+x^3ye^{xy}cos(x^2y)-x^4ye^{xy}sin(x^2y)+2x^3e^{xy}cos(x^2y)-2x^4e^{xy}sin(x^2y)-2x^4e^{xy}sin(x^2y)-2x^5e^{xy}cos(x^2y)$$

$$\displaystyle f_{xyyy}=x^2e^{xy}sin(x^2y)+x^3e^{xy}cos(x^2y)+x^3e^{xy}cos(x^2y)-x^4e^{xy}sin(x^2y)+x^2e^{xy}sin(x^2y)+x^3e^{xy}cos(x^2y)+x^2e^{xy}sin(x^2y)+x^3ye^{xy}sin(x^2y)+x^4ye^{xy}cos(x^2y)+x^3e^{xy}cos(x^2y)+x^4ye^{xy}cos(x^2y)-x^5ye^{xy}sin(x^2y)+x^3e^{xy}cos(x^2y)-x^4e^{xy}sin(x^2y)+x^3e^{xy}cos(x^2y)+x^4ye^{xy}cos(x^2y)-x^5ye^{xy}sin(x^2y)-x^4e^{xy}sin(x^2y)-x^5ye^{xy}sin(x^2y)-x^6ye^{xy}cos(x^2y)+2x^4e^{xy}cos(x^2y)-2x^5e^{xy}sin(x^2y)-2x^4e^{xy}sin(x^2y)-2x^6e^{xy}cos(x^2y)-2x^5e^{xy}sin(x^2y)-2x^6e^{xy}cos(x^2y)-2x^6e^{xy}cos(x^2y)+2x^7e^{xy}sin(x^2y)$$

So, I know that it is possible to write it in a shorter way, but I don't know how. Because for me it looks so messy the way I did it.
So then:$$\displaystyle f(1,\pi)= \frac{4!}{3!}\cdot( e^{\pi}+ e^{\pi}+e^{\pi}+\pi e^{\pi}+e^{\pi}+\pi e^{\pi}+e^{\pi}+e^{\pi}+\pi e^{\pi}-\pi e^{\pi}+2e^{\pi}-2e^{\pi}-2e^{\pi})= 6 \cdot (4\pi +\pi e^{\pi})$$

So, the Taylor expansions term that corresponds to given $$\displaystyle n$$ and $$\displaystyle k$$ is:
$$\displaystyle 6\cdot(4\pi + \pi e^{\pi})(x-1)(x-\pi)^3$$

#### Jomo

##### Elite Member
Before computing fxyy please factor fxy and then compute the partial derivative!

#### Zappa

##### New member
Ok. How is it now?
$$\displaystyle f_{xy}=e^{xy}(sin(x^2y)+xysin(x^2y)+x^2ycos(x^2y)+2x^2cos(x^2y)-2x^3sin(x^2y))$$

$$\displaystyle f_{xyy}=e^{xy}x(sin(x^2y)+xysin(x^2y)+x^2ycos(x^2y)+2x^2cos(x^2y)-2x^3sin(x^2y)) + x^2cos(x^2y)+xsin(x^2y)+x^3ycos(x^2y)+x^2cos(x^2y)-x^4ysin(x^2y)-2x^3sin(x^2y)-2x^5cos(x^2y)$$

$$\displaystyle f_{xyyy}=e^{xy}(x^3cos(x^2y)+x^2sin(x^2y)+x^4ycos(x^2y)+x^3cos(x^2y)-x^5ysin(x^2y))-2x^5sin(x^2y)-2x^6cos(x^2y)-x^4sin(x^2y)+z^3cos(x^2y)+x^3cos(x^2y)-x^5ysin(x^2y)-x^4sin(x^2y)-x^4sin(x^2y)-x^6ycos(x^2y)-2x^5cos(x^2)-2x^7sin(x^2y)$$

#### Zappa

##### New member
Sorry the derivative is incorrect.
$$\displaystyle f_{xyy}=xf_{xy}+e^{xy}(x^2cos(x^2y)+xsin(x^2y)+x^3ycos(x^2y)+x^2cos(x^2y)-x^4ysin(x^2y)-2x^4sin(x^2y)-2x^5cos(x^2y))$$
$$\displaystyle f_{xyy}=xf_{xy}+e^{xy}(cos(x^2y)(2x^2+x^3y-2x^5)+sin(x^2y)(x-3x^4))$$
$$\displaystyle f_{xyyy}=f_{xyy}+x^3e^{xy}cos(x^2y)+e^{xy}cos(x^2y)(2x^3+x^4y-2x^6)-e^{xy}sin(x^2y)(2x^4+x^5y-2x^7)+e^{xy}sin(x^2y)(x^2-3x^5)+e^{xy}cos(x^2y)(x^3-3x^6)$$

#### Zappa

##### New member
So, $$\displaystyle f_{xy}(1;\pi)=e^{\pi}(-\pi -2)=-\pi e^{\pi}-2e^{\pi}$$
$$\displaystyle f_{xyy}=-\pi e^{\pi} -2e^{\pi} + e^{\pi}(-\pi)= -2\pi e^{\pi}-2e^{\pi}$$
$$\displaystyle f_{xyyy}=-2\pi e^{\pi} -2e^{\pi} -e^{\pi}-\pi e^{\pi} +2e^{\pi}=-e^{\pi}-3\pi e^{\pi}$$
Then $$\displaystyle f(1;\pi)= \frac{1}{3!}(-e^{\pi}-3\pi e^{\pi}) (x-1)(x-\pi)^3$$