Homework, 14.7: #4, 12, 20, 40, 48, 54, pp. 978--
MAT329, Fall 2015
Andy Long

#4

f[x_,y_]:=3x-x^3-2y^2+y^4
Plot3D[f[x,y],{x,-2,2},{y,-2,2}]
ContourPlot[f[x,y],{x,-2,2},{y,-2,2},Contours->{-2.9, -2.7,-2.5,-2,-1.5,-1,0,.5,1,1.5,1.7,1.9}]
fx[x_,y_]=D[f[x,y],x]
fy[x_,y_]=D[f[x,y],y]
fxx[x_,y_]=D[f[x,y],x,x]
fxy[x_,y_]=D[f[x,y],x,y]
fyy[x_,y_]=D[f[x,y],y,y]

Disc[x_,y_]:=fxx[x,y]*fyy[x,y]-fxy[x,y]^2
Disc[-1,1]
fxx[-1,1]
Disc[1,0]
fxx[1,0]
Disc[1,1]
fxx[1,1]

#12

f[x_,y_]:=x y+1/x+1/y
Plot3D[f[x,y],{x,-3,3},{y,-3,3}]
ContourPlot[f[x,y],{x,-3,3},{y,-3,3}]
fx[x_,y_]=D[f[x,y],x]
fx[x,y]
fy[x_,y_]=D[f[x,y],y]
fy[x,y]
fxx[x_,y_]=D[f[x,y],x,x]
fxy[x_,y_]=D[f[x,y],x,y]
fyy[x_,y_]=D[f[x,y],y,y]
Disc[1,1]
fxx[1,1]
f[1,1]

#20: 2plug-n-chug4me? I just need to do a copy and paste, once I’ve done programmed it up properly.

f[x_,y_]:=x^2y E^(-(x^2+y^2))
width=-3
Plot3D[f[x,y],{x,-width,width},{y,-width,width},Mesh->20,PlotRange->All]
fx[x_,y_]=D[f[x,y],x];
fy[x_,y_]=D[f[x,y],y];
fxx[x_,y_]=D[f[x,y],x,x];
fxy[x_,y_]=D[f[x,y],x,y];
fyy[x_,y_]=D[f[x,y],y,y];

Simplify[fx[x,y]]
Simplify[fy[x,y]]
Simplify[fxx[x,y]]
Simplify[fxy[x,y]]
Simplify[fyy[x,y]]

Disc[1,1/Sqrt[2]]
fxx[1,1/Sqrt[2]]
Disc[1,-1/Sqrt[2]]
fxx[1,-1/Sqrt[2]]

#40: we’ll minimize d^2 rather than d.

f[x_,y_]:=x^2+(y-1)^2+(2-x/3+2y/3)^2
width=-3
Plot3D[f[x,y],{x,-width,width},{y,-width,width},Mesh->20,PlotRange->All]
fx[x_,y_]=D[f[x,y],x];
fy[x_,y_]=D[f[x,y],y];
soln=Solve[fx[x,y]==0&&fy[x,y]==0]

fxx[x_,y_]=D[f[x,y],x,x];
fxy[x_,y_]=D[f[x,y],x,y];
fyy[x_,y_]=D[f[x,y],y,y];

xs=Replace[x,soln]
ys=Replace[y,soln]
Disc[xs,ys]
fxx[xs,ys]

#43: 2plug-n-chug4me -- so use your powers of Mathematica and creativity to make it relatively easy and elegant!

Clear[l,w,h]
volume[l_,w_,h_]:=l w h
area[l_,w_,h_]:=2(l w + w h + h l)
root=Solve[area[l,w,h]==64,h]
h=Replace[h,root[[1]][[1]]]
root=Solve[D[volume[l,w,h],l]==0 && D[volume[l,w,h],w]==0,{l,w}]
{l,w}={Replace[l,root[[2]][[1]]],Replace[l,root[[2]][[2]]]}
h

#54:

f[x_,y_]:=2(x y+(x+y)(1-x-y))
width=-3
Plot3D[f[x,y],{x,-width,width},{y,-width,width},Mesh->20,PlotRange->All]
fx[x_,y_]=D[f[x,y],x];
fy[x_,y_]=D[f[x,y],y];
fx[x,y]
fy[x,y]
soln=Solve[fx[x,y]==0&&fy[x,y]==0]

fxx[x_,y_]=D[f[x,y],x,x];
fxy[x_,y_]=D[f[x,y],x,y];
fyy[x_,y_]=D[f[x,y],y,y];

xs=Replace[x,soln]
ys=Replace[y,soln]
Disc[xs,ys]
fxx[xs,ys]
f[xs,ys]