Partial Derivatives and Their Graphs

First we define an expression that represents the value of f(x,y).

> f:=x^2+4*x^2*y-3*y^2;

f := x^2+4*x^2*y-3*y^2

We can plot the graph z = f(x,y) using plot3d.

> plot3d(f,x=-2..2,y=-2..2,axes=boxed);

[Maple Plot]

The partial derivative of f with respect to x can be found using diff.

> fx:=diff(f,x);

fx := 2*x+8*x*y

Two or more graphs can be displayed on one set of axes by drawing the graphs separately and saving them.

Let a be the graph of fx. Note that we use a colon (rather than a semicolon) to avoid printing data we would

just as soon not see.

> a:=plot3d(fx,x=-2..2,y=-2..2):

Let xy be the graph of the xy plane, z = 0.

> xy:=plot3d(0,x=-2..2,y=-2..2):

To display the two graphs together, we use the command, display , which is in the plots library

> with(plots);

[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...

> display(a,xy,axes=boxed);

[Maple Plot]

We can do the same with the partial of f with respect to y.

> fy:=diff(f,y);

fy := 4*x^2-6*y

> b:=plot3d(fy,x=-2..2,y=-2..2):

> display(b,xy,axes=boxed);

[Maple Plot]

Likewise, we can look at the second partials.

> fxx := diff(f,x,x);

fxx := 2+8*y

> c:=plot3d(fxx,x=-2..2,y=-2..2):

> display(c,xy,axes=boxed);

[Maple Plot]

> fxy := diff(f,x,y);

fxy := 8*x

> d:=plot3d(fxy,x=-2..2,y=-2..2):

> display(d,xy,axes=boxed);

[Maple Plot]

> fyy := diff(f,y,y);

fyy := -6

>