Partial derivativesGreg Warrington - warrings@wfu.eduEvaluate this worksheet by selecting "Edit->Execute->Worksheet" from the menus above.The animation at the bottom is designed to help you visualize a partial derivative of a function.A description can be found above the plot.restart:
with(LinearAlgebra):
with(plots):
with(plottools):
xlim := 1: ylim := 1:
setoptions3d(font=[TIMES,BOLD,18],titlefont=[TIMES,BOLD,18]):nf := 20:
f := proc(x,y) 4 - x^2 - 2*y^2 end proc:
fx := diff(f(x,y),x);
fy := diff(f(x,y),y);
surf := plot3d(f(x,y),x=0..2,y=0..2,view=[0..2,0..1.5,0..4],transparency=0.3):
pla := plot3d([s,1,t],s=0..2,t=0..4,style=PATCHNOGRID):
getl := proc(t,nf,ffx)
[t/nf+2,1,f(t/nf,1)+2*subs(x=t/nf,ffx)]
end proc:
getl2 := proc(t,nf,ffx)
[t/nf-1,1,f(t/nf,1)-subs(x=t/nf,ffx)]
end proc:
cur := display([seq(line([t/nf,1,f(t/nf,1)],getl(t,nf,fx),color=RED,thickness=2),t=0..nf)],insequence=true):
cur2 := display([seq(line([t/nf,1,f(t/nf,1)],getl2(t,nf,fx),color=RED,thickness=2),t=0..nf)],insequence=true):
pt := display([seq(sphere([t/nf,1,f(t/nf,1)],0.05,color=BLACK),t=0..nf)],insequence=true):fx(1);Illustrated is the surface f(x,y) = 4 - x^2 - 2*y^2.The intersection of the vertical plane and f(x,y) is the curve g(x) = f(x,1).If you click on the animation and move the slider that appears above, the red line movesthrough the tangent lines at the various points you select (indicated by the black dot).The value of the partial derivative with respect to x each of these points is the slope of the appropriate red tangent line.In our case, f_x(x,y) = -2*x. So as x gets larger, the slope of the red line gets more and more negative.Notice that since "y" does not appear in f_x, the slopes we get are independent of which vertical slice we take.display({surf,pla,cur,cur2,pt},axes=BOXED);