Level Curves and Surfaces

The graph of a function of two variables is a surface in space. Pieces of graphs can be plotted with Maple using the command  plot3d. For example, to plot the portion of the graph of the function  f(x,y)=x2+y2 corresponding to x between -2 and 2 and y between -2 and 2, type

> with (plots);
> plot3d(x^2+y^2,x=-2..2,y=-2..2);

To draw the coordinate exaes, use either "Normal" from the Axes menu of the 3D display window, or enter  axes=normal as an option in  plot3d.   To obtain more accurate graphs of certain functions, it is helpful to use the option  numpoints , for example,

> plot3d(x^2+y^2,x=-2..2,y=-2..2,axes=normal,numpoints=1000);

To see the details of the graph around a particular point, it is useful to zoom in. To do this, for example, around the point (1,1), make a new plot with a different ranges of x and y:

> plot3d(x^2+y^2,x=-0.9..1.1,y=-0.9..1.1,axes=normal);
 

Level curves

The graph of a function  f(x,y) can be studied by drawing level curves  f(x,y)=c  corresponding to various values of the constant  c.  There is a Maple command that will plot several level curves in the same plot for a given function with evenly spaced values of  c.  For example, to plot level curves for the above function  f(x,y), use the command

> contourplot(x^2+y^2,x=-2..2,y=-2..2,scaling=constrained,
  axes=normal);

The  option  scaling=constrained is added here to make for a more accurate plot - without it the level curves (which are circles) would look like ellipses.  To increase or decrease the number of level curves drawn you may want to use option  contours . For example,  contours=15 specifies 15 contours in the plot.

In general, the result of  contourplot looks like a topographical map of a landscape where the value of  f  at a point represents the elevation. Such a map shows the general features of the landscape by drawing curves through points which have the same elevation. Notice that in the example above the level curves are not evenly spaced - their higher concentration further away from the origin indicates that the graph is getting steeper.  Also notice that there is a minimum in the center of the picture. Try the same plot with a larger number of contours to see a family of smaller and smaller circles shrinking to the origin.

The command  contourplot does not allow to plot a level curve   f(x,y)=c  for a specific value of  c. There is however another Maple command that will do just that. For example,

> implicitplot(x^2+y^2=1,x=-2..2,y=-2..2,scaling=constrained);

will plot a circle of radius 1.
 
 

Functions of three variables

For a function of three variables  f(x,y,z)  the notion corresponding to the level curve of a two-variable function is a level surface,  f(x,y,z)=c. This is generally a surface, which can be plotted with the help of Maple. For example,

> implicitplot3d(9*x^2 + 4*y^2 + z^2 = 1,x=-1..1,y=-1..1,z=-1..1,
  scaling=constrained);

plots the ellipsoid  9x2+4y2+z2=1 which is a level surface of the function  f(x,y,z)=9x2+4y2+z2 .