Taylor Polynomial in
two variables

If we know the value of f(x, y) and its partial derivatives at a point x = a, y = b, then the Taylor polynomial in two variables allow us to estimate f(x, y) at points near to (a, b). We define the Taylor polynomial of degree n generated by f at x = a, y = b as a function in the same way as the polynomial in one variabel by:

> restart:

> readlib(mtaylor):

> P:=(f,a,b,n,u,v)->subs(x=u,y=v,mtaylor(f,[x = a,y=b],n+1)):

The Taylor polynomial of degree 2 at (a, b) is:

> 'P(f(x,y),a,b,2,x,y)'=P(f(x,y),a,b,2,x,y);

[Maple Math]
[Maple Math]

With f(x, y) = 2 + cos(x) + sin(y), (a, b) = (0, 2) and n = 2 we get the following approximating to f(x, y) at the point ( 3, 3).

> f:=(x,y)->2+cos(x)+sin(y):

> 'P'(f(x,y),0,2,2,x,y)=P(f(x,y),0,2,2,x,y);

[Maple Math]

> 'P'(f(3,3),0,2,2,1,-1)=evalf(P(f(x,y),0,2,2,1,-1));

[Maple Math]

> f(3,3)=evalf(f(1,-1));

[Maple Math]

> 'P'(f(3,3),0,2,12,1,-1)=evalf(P(f(x,y),0,2,12,1,-1));

[Maple Math]

With n = 12 the values of the Taylor polynomial and the funtion are in close agreement, which is visualized in Figure 1.

> f:=(x,y)->2+cos(x)+sin(y):

Taylor3D (f, a, b, n ) animates a Taylor polynomial of dgreee n generetated by f (x, y) at x = a , y = b .

> Taylor3D(f,0,2,12,x=-2..2,y=-4..4,z=0..4,axes=frame,orientation=[-19,86]);

[Maple Plot]

Figure 1 Animation of Taylor polynomials generated by [Maple Math] at (0, 2)