Lab05 - Partial derivatives

[Your name(s) here...]

Compare and contrast partial derivatives and derivatives.

A partial derivative of a multivariable function is a derivative with respect to one of the variables holding the other variables constant.

Write out how you understand  g'(a), (Subscript[f, x])(a,b), and (Subscript[f, y])(a,b).

Suppose f(x,y)=y cos(x (y^3)). Find the following partial derivatives by hand (before executing the Mathematica code below):

f(π/2,1)=

(Subscript[f, x])(π/2,1)=

(Subscript[f, y])(π/2,1)=

Mathematica function approach.

f[x_,y_]:=y Cos[x (y^3)]
f[π/2,1]

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

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

Mathematica expression approach.

z=y Cos[x (y^3)];
z/.{x->π/2,y->1}
D[z,x]/.{x->π/2,y->1}
D[z,y]/.{x->π/2,y->1}

Plotting the surface to enable graphical intuition.

plot1=Plot3D[z,{x,0,π},{y,0,2},ViewPoint->{10,10,20},
AxesLabel->{x,y,"z"},LabelStyle->Directive[Bold, Medium]];
plot2=Graphics3D[{Opacity[.5],Blue,Polygon[{{0,1,-2},{0,1,2},{π,1,2},{π,1,-2}}],Gray,Polygon[{{(π/2),0,-2},{(π/2),0,2},{(π/2),2,2},{(π/2),2,-2}}]}];
Show[plot1,plot2]

Based on the surface plot above, hand sketch first each of the 2 plots below, before executing the Mathematica commands to plot them.  Think carefully about identifying the positive direction for the dependent variable!


Then, execute the plots and print the part of this notebook that includes the two plots and (further below) the contour plots.  Draw points and lines on your printout to estimate (Subscript[f, x])(π/2,1) and (Subscript[f, y])(π/2,1).

Plot[f[π/2,y],{y,0,2}]

Plot[f[x,1],{x,0,π}]

Use your printout of the contour plot  to estimate (Subscript[f, x])(π/2,1) and (Subscript[f, y])(π/2,1).

p3=ContourPlot[f[x,y],{x,0,π},{y,0,2}];
p4=Graphics[{Red,Line[{{π/2,0},{π/2,2}}],Line[{{0,1},{π,1}}]}];
Show[p3,p4]

Your estimates....

(Subscript[f, x])(π/2,1)=

(Subscript[f, y])(π/2,1)=

Also estimate whether these quantities are positive or negative:

(Subscript[f, xx])(π/2,1) 

(Subscript[f, xy])(π/2,1)

Figure out how to calculate those second-order derivatives in Mathematica

Comment: Why is the view point default in Mathematica (positive, negative, positive)?

To hand in this lab, save your Mathematica notebook file in your Google Drive folder, but also include snapshots of your printouts with estimates.