My solutions to the April 15 In-Class work

Math 104 Calculus II, April 15, 2019
T. Ratliff, Wheaton College
ratliff_thomas@wheatoncollege.edu

1. f(x,y) = 25 (x^4) - 30 (x^2) + 4 (y^2) - 12 y + 18

f=25x^4 - 30x^2 + 4y^2 - 12 y + 18
Solve[{D[f,x]==0,D[f,y]==0}]

N[%]

ContourPlot[f,{x,-1,1},{y,1,2},Contours->30,ColorFunction->"Rainbow"]
Plot3D[f,{x,-1,1},{y,-1,3},MeshFunctions->{#3&},Mesh->30,ColorFunction->"Rainbow"]

Therefore, 
	( -0.77, 1.5) is a local min
	(0, 1.5) is a saddle point
	(0.77, 1.5) is a local min

2. g(x,y) = -((((x^2)-1))^2) - ((((x^2)y-x-1))^2)

g=-(x^2-1)^2 - (x^2 y - x - 1)^2
Solve[{D[g,x]==0,D[g,y]==0}]

ContourPlot[g,{x,-2,2},{y,-1,3},Contours->50,ColorFunction->"Rainbow"]
Plot3D[g,{x,-1.5,1.5},{y,-1,3},MeshFunctions->{#3&},Mesh->30,ColorFunction->"Rainbow"]

Therefore, 
	(-1,0) is a local max
	(1,2) is a local max

3. v(x,y) = ((x y (60 - x y))/(2x +2 y))

v = (x y (60-x y))/(2x + 2y)
Solve[{D[v,x]==0,D[v,y]==0}]

N[%]

ContourPlot[v,{x,3,6},{y,3,6},Contours->30,ColorFunction->"Rainbow"]
Plot3D[v,{x,3,6},{y,3,6},MeshFunctions->{#3&},Mesh->30,ColorFunction->"Rainbow"]

Therefore, 
	x=4.47, y=4.47 gives a max 

Let’s find z corresponding to the critical value (2 Sqrt[5], 2 Sqrt[5])

(60-2Sqrt[5]*2Sqrt[5] )/(2*2Sqrt[5] + 2*2Sqrt[5])

N[%]

The dimensions of our box are x=4.47 ft, y=4.47 ft, and z=2.23 ft

And the maximum volume is V=2 Sqrt[5] * 2 Sqrt[5] * Sqrt[5] = 20 Sqrt[5] = 44.72 ft^3

4. d(x,y) = (((x-3))^2) + (((y-2))^2)+((((x^2)+(y^2)-6))^2)

p1=Plot3D[x^2+y^2, {x,-4,4},{y,-4,4},ColorFunction->"Rainbow"];
p2=Graphics3D[{Red,Sphere[{3,2,6},0.5]}];
Show[p2,p1]

d=(x-3)^2 + (y-2)^2 +(x^2 + y^2 -6)^2
Solve[{D[d,x]==0,D[d,y]==0},Reals]

This isn’t really informative, but Mathematica has a numeric solve option NSolve[ ]

NSolve[{D[d,x]==0,D[d,y]==0},Reals]

Much better

ContourPlot[d,{x,-3,3},{y,-2,2},Contours->50,ColorFunction->"Rainbow"]
Plot3D[d,{x,-3,3},{y,-2,2},MeshFunctions->{#3&},Mesh->50,ColorFunction->"Rainbow"]

Therefore, 
	(2.07558, 1.38372) is a local min
	(-1.79718, -1.19812) is a saddle point
	(-0.278394, -0.185596) is a local max

We can plug the critical points into d to see which gives the smallest value and therefore is the closest.

d/. {x->2.07558,y->1.38372}
d/. {x->-1.79718,y->-1.19812}
d/. {x->-0.278394,y->-0.185596}

Therefore, (2.07558, 1.38372) gives the minimum value for d. 
We can find the z-value by plugging into z = x^2 + y^2

2.07558^2 + 1.38372^2

Therefore, the point (2.07558, 1.38372, 6.22271) is the point on z=x^2+y^2 closest to (3,2,6)

5. h(x,y) = 5 - 10 x y - 4 (x^2) + 3 y - (y^4)

This is another one where using the NSolve[ ] command is useful

h = 5 - 10 x y - 4x^2 + 3y - y^4
NSolve[{D[h,x]==0,D[h,y]==0},Reals]

ContourPlot[h,{x,-3,3},{y,-2,2},Contours->50,ColorFunction->"Rainbow"]
Plot3D[h,{x,1,3},{y,-3,0},MeshFunctions->{#3&},Mesh->50,ColorFunction->"Rainbow"]

Therefore, 
	(-2.34671, 1.87736) is local max
	(2.04085, -1.63268) is alocal max
	(0.30586, -0.244688)is a saddle point