14.10

The formulas

Here are the formulas you would subsitute into for the quadratic and cubic approximations:

Clear[f]

(∑_(i=0)^2)(1/(i!))((∑_(k=0)^i)Binomial[i,k](x^(i-k))(y^k)Derivative[i-k,k][f][0,0])

(∑_(i=0)^3)(1/(i!))((∑_(k=0)^i)Binomial[i,k](x^(i-k))(y^k)Derivative[i-k,k][f][0,0])

Example 14.10.4

Find the quadratic and cubic approximations to f(x,y)=sin x cos y about the origin.

Barry's Solution

f[x_,y_]=Sin[x] Cos[y]
n=2;
(∑_(i=0)^n)(1/(i!))((∑_(k=0)^i)Binomial[i,k](x^(i-k))(y^k)Derivative[i-k,k][f][0,0]);
quartic[x_,y_]=Expand[%]

n=3;
(∑_(i=0)^n)(1/(i!))((∑_(k=0)^i)Binomial[i,k](x^(i-k))(y^k)Derivative[i-k,k][f][0,0]);
cubic[x_,y_]=Expand[%]

That's all we need. You should be able to do these by hand, and if you did them by hand you should have found the following derivatives:

f[x,y]

D[f[x,y],{x,1}]
D[f[x,y],{y,1}]

D[f[x,y],{x,2}]
D[f[x,y],{x,1},{y,1}]
D[f[x,y],{y,2}]

D[f[x,y],{x,3}]
D[f[x,y],{x,2},{y,1}]
D[f[x,y],{x,1},{y,2}]
D[f[x,y],{y,3}]

These should be evaluated at x=y=0:

f[x,y]/.x->0/.y->0

D[f[x,y],{x,1}]/.x->0/.y->0
D[f[x,y],{y,1}]/.x->0/.y->0

D[f[x,y],{x,2}]/.x->0/.y->0
D[f[x,y],{x,1},{y,1}]/.x->0/.y->0
D[f[x,y],{y,2}]/.x->0/.y->0

D[f[x,y],{x,3}]/.x->0/.y->0
D[f[x,y],{x,2},{y,1}]/.x->0/.y->0
D[f[x,y],{x,1},{y,2}]/.x->0/.y->0
D[f[x,y],{y,3}]/.x->0/.y->0

Now just substitute these numbers into the formulas.

Example 14.10.6

Find the quadratic and cubic approximations to f(x,y)=ln(2x+y+1) about the origin.

Barry's Solution

f[x_,y_]=Log[2x+y+1]
n=2;
(∑_(i=0)^n)(1/(i!))((∑_(k=0)^i)Binomial[i,k](x^(i-k))(y^k)Derivative[i-k,k][f][0,0]);
quartic[x_,y_]=Expand[%]

n=3;
(∑_(i=0)^n)(1/(i!))((∑_(k=0)^i)Binomial[i,k](x^(i-k))(y^k)Derivative[i-k,k][f][0,0]);
cubic[x_,y_]=Expand[%]

That's all we need. You should be able to do these by hand, and if you did them by hand you should have found the following derivatives:

f[x,y]

D[f[x,y],{x,1}]
D[f[x,y],{y,1}]

D[f[x,y],{x,2}]
D[f[x,y],{x,1},{y,1}]
D[f[x,y],{y,2}]

D[f[x,y],{x,3}]
D[f[x,y],{x,2},{y,1}]
D[f[x,y],{x,1},{y,2}]
D[f[x,y],{y,3}]

These should be evaluated at x=y=0:

f[x,y]/.x->0/.y->0

D[f[x,y],{x,1}]/.x->0/.y->0
D[f[x,y],{y,1}]/.x->0/.y->0

D[f[x,y],{x,2}]/.x->0/.y->0
D[f[x,y],{x,1},{y,1}]/.x->0/.y->0
D[f[x,y],{y,2}]/.x->0/.y->0

D[f[x,y],{x,3}]/.x->0/.y->0
D[f[x,y],{x,2},{y,1}]/.x->0/.y->0
D[f[x,y],{x,1},{y,2}]/.x->0/.y->0
D[f[x,y],{y,3}]/.x->0/.y->0

Now just substitute these numbers into the formulas.