Exercise 3, page 809
\[ g(x,y)=4+x^3+y^3-3xy \]
(%i86) | g(x,y):=4+x^3+y^3-3*x*y; |
(%i94) | gradg: [diff(g(x,y),x),diff(g(x,y),y)]; |
(%i96) | solve(gradg,[x,y]); |
(%i92) |
wxdraw3d( explicit(g(x,y),x,-1,2,y,-1,2), contour_levels={-4,-2,0,2,4,6,7,8}, contour=base); |
We can define the function \( D = f_{xx}f_{yy}-(f_{xy})^2 \) from the second derivative test on page 803:
(%i16) | D: diff(g(x,y),x,2)*diff(g(x,y),y,2)-diff(g(x,y),x,1,y,1)^2; |
Evaluating \( D \) at each of the (real) critial points shows that there's no local max or min at (0,0),
and there's a local min at (1,1)
(%i22) | subst([x=0,y=0],D); |
(%i28) | ev(D,x=1,y=1); |
(%i88) | diff(g(x,y),x,2); |
(%i89) | ev(%,x=1,y=1); |
Example 4, page 804
\[ f(x,y)= 10x^2y-5x^2-4y^2-x^4-2y^4 \]
(%i58) | f(x,y):=10*x^2*y-5*x^2-4*y^2-x^4-2*y^4; |
(%i97) |
wxdraw3d( explicit(f(x,y),x,-3,3,y,-1,3), contour_levels=[-4,1,4], contour=base); |
(%i59) | gradf: [diff(f(x,y),x),diff(f(x,y),y)]; |
(%i62) | sol:solve(gradf,[x,y]); |
What a lot of solutions! Notice that we can refer to them by their number in the order they are given above, i.e.
(%i64) | sol[3]; |
--> | subst(sol[5],f(x,y)); |
And we could use the second derivative test to see there is a local max at approximately (2.65,1.90)
(%i105) | sol[9]; |
(%i70) | D:diff(f(x,y),x,2)*diff(f(x,y),y,2)-diff(f(x,y),x,1,y,1)^2; |
(%i103) | subst(sol[9],D); |
(%i104) | subst(sol[9],diff(f(x,y),x,2)); |