Total Differential of the First Order

f={x^2+y^2,x y,1-x^2-y^2};

Manipulate[With[{f=f[[i]]},With[{fx=D[f,x],fy=D[f,y]},With[{dz=(fx/.{x->x0,y->y0})dx+(fy/.{x->x0,y->y0})dy},Show[Plot3D[{f},{x,x0-dx/4,x0+5dx/4},{y,y0-dy/4,y0+5dy/4},Mesh->False,PlotStyle->{Gray,Opacity[surfopac]},AxesLabel->{x,y,z}],ParametricPlot3D[{x,y0,f/.{y->y0}},{x,x0-dx/4,x0+5 dx/4}],ParametricPlot3D[{x0,y,f/.{x->x0}},{y,y0-dy/4,y0+5 dy/4}],Graphics3D[{If[tanplane,{Opacity[0.8],Polygon[{{x0,y0,f/.{x->x0,y->y0}},{x0+dx,y0,(f/.{x->x0,y->y0})+(fx/.{x->x0,y->y0})dx},{x0+dx,y0+dy,(f/.{x->x0,y->y0})+dz},{x0,y0+dy,(f/.{x->x0,y->y0})+(fy/.{x->x0,y->y0})dy},{x0,y0,f/.{x->x0,y->y0}}}]},{}],PointSize[0.015],Point[{x0+dx,y0+dy,(f/.{x->x0,y->y0})+dz}],Point[{x0+dx,y0+dy,(f/.{x->x0+dx,y->y0+dy})}],Point[{x0+dx,y0+dy,(f/.{x->x0,y->y0})}],Point[{x0+dx,y0,(f/.{x->x0,y->y0})+(fx/.{x->x0,y->y0})dx}],Point[{x0,y0+dy,(f/.{x->x0,y->y0})+(fy/.{x->x0,y->y0})dy}],Point[{x0,y0,f/.{x->x0,y->y0}}],{RGBColor[0.501961, 1, 0.501961],Thickness[thic 0.01],Line[{{x0,y0,f/.{x->x0,y->y0}},{x0+dx,y0,(f/.{x->x0,y->y0})},{x0+dx,y0+dy,(f/.{x->x0,y->y0})},{x0,y0+dy,(f/.{x->x0,y->y0})},{x0,y0,f/.{x->x0,y->y0}}}],RGBColor[1, 0.501961, 1],Line[{{x0,y0,f/.{x->x0,y->y0}},{x0+dx,y0,(f/.{x->x0,y->y0})+(fx/.{x->x0,y->y0})dx},{x0+dx,y0+dy,(f/.{x->x0,y->y0})+dz},{x0,y0+dy,(f/.{x->x0,y->y0})+(fy/.{x->x0,y->y0})dy},{x0,y0,f/.{x->x0,y->y0}}}],RGBColor[1, 0, 0],Line[{{x0+dx,y0,(f/.{x->x0,y->y0})},{x0+dx,y0,(f/.{x->x0,y->y0})+(fx/.{x->x0,y->y0})dx}}],Line[{{x0,y0+dy,(f/.{x->x0,y->y0})},{x0,y0+dy,(f/.{x->x0,y->y0})+(fy/.{x->x0,y->y0})dy}}],Line[{{x0+dx,y0+dy,(f/.{x->x0,y->y0})},{x0+dx,y0+dy,(f/.{x->x0,y->y0})+dz}}],RGBColor[0, 0.501961, 0],Line[{{x0+dx,y0+dy,(f/.{x->x0+dx,y->y0+dy})},{x0+dx,y0+dy,(f/.{x->x0,y->y0})+dz}}],Line[{{x0,y0,(f/.{x->x0,y->y0})},{x0+dx,y0+dy,(f/.{x->x0,y->y0})}}]},Opacity[1],If[text,{Text[Style["dz",Italic,18],({x0+dx,y0+dy,(f/.{x->x0,y->y0})}+{x0+dx,y0+dy,(f/.{x->x0,y->y0})+dz})/2 +{dx,dy,0}/15],Text[Style["(Subscript[f, x])dx",Italic,20],({x0+dx,y0,(f/.{x->x0,y->y0})}+{x0+dx,y0,(f/.{x->x0,y->y0})+(fx/.{x->x0,y->y0})dx})/2 +{dx,0,0}/15],Text[Style["(Subscript[f, y])dy",Italic,18],({x0,y0+dy,(f/.{x->x0,y->y0})}+{x0,y0+dy,(f/.{x->x0,y->y0})+(fy/.{x->x0,y->y0})dy})/2 +{dy,0,0}/15],Text[Style["η",Italic,18],({x0+dx,y0+dy,(f/.{x->x0+dx,y->y0+dy})}+{x0+dx,y0+dy,(f/.{x->x0,y->y0})+dz})/2 +{dx,dy,0}/15],Text[Style["ρ",Italic,18],({x0,y0,(f/.{x->x0,y->y0})}+{x0+dx,y0+dy,(f/.{x->x0,y->y0})})/2 ,{0,1}],Text[Style["dx",Italic,18],({x0,y0,(f/.{x->x0,y->y0})}+{x0+dx,y0,(f/.{x->x0,y->y0})})/2 ,{0,1}],Text[Style["dy",Italic,18],({x0+dx,y0,(f/.{x->x0,y->y0})}+{x0+dx,y0+dy,(f/.{x->x0,y->y0})})/2 ,{0,1}]},{}],If[text2,{Text[Style["(x,y,f(x,y))",Italic,12],{x0,y0,(f/.{x->x0,y->y0})},{0,1}],Text[Style["(x+dx,y,f(x,y))",Italic,12],{x0+dx,y0,(f/.{x->x0,y->y0})},{0,1}],Text[Style["(x,y+dy,f(x,y))",Italic,12],{x0,y0+dy,(f/.{x->x0,y->y0})},{0,1}],Text[Style["(x+dx,y+dy,f(x,y))",Italic,12],{x0+dx,y0+dy,(f/.{x->x0,y->y0})},{0,1}],Text[Style["(x+dx,y+dy,f(x+dx,y+dy))",Italic,12],{x0+dx,y0+dy,(f/.{x->x0+dx,y->y0+dy})},{0,-1}]},{}],If[hor,{RGBColor[0.384314, 0.941176, 0.396078],Polygon[{{x0+dx,y0+dy,f/.{x->x0,y->y0}},{x0,y0+dy,f/.{x->x0,y->y0}},{x0,y0,f/.{x->x0,y->y0}},{x0+dx,y0,f/.{x->x0,y->y0}}}]},{}]}],Boxed->False,Axes->axes,AspectRatio->1,PlotRange->All,ViewPoint->10{10,5,1},ImageSize->{340,340}]/.{x_,y_,z_Complex}:>{x,y,z[[1]]}]]],
{{i,1,"f(x,y)="},{1->"(x^2)+(y^2)",2->"xy",3->"1-(x^2)-(y^2)"}},
{{x0,0.4,"x"},-1,1,0.1,ImageSize->Tiny,Appearance->"Labeled"},
{{y0,0.3,"y"},-1,1,0.1,ImageSize->Tiny,Appearance->"Labeled"},
{{dx,0.3},0.004,1,0.005,ImageSize->Tiny,Appearance->"Labeled"},
{{dy,0.3},0.004,1,0.005,ImageSize->Tiny,Appearance->"Labeled"},
{{surfopac,0.3,"surface opacity"},0,1,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{thic,0.1,"thickness"},0.1,1,.1,ImageSize->Tiny,Appearance->"Labeled"},
{{axes,False,"show axes"},{False,True}},
{{hor,True,"show horizontal plane"},{False,True}},
{{tanplane,True,"show tangent plane"},{False,True}},
{{text,True,"show text"},{False,True}},
{{text2,False,"show additional text"},{False,True}},
SaveDefinitions->True]

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Total Differential of the First Order" from The Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/TotalDifferentialOfTheFirstOrder/

Contributed by: Izidor Hafner

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© The Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »