next up previous
Next: About this document ...

MA 1024 Lab 2: Displaying functions of two variables

Background

The graph of a function of a single real variable is a set of points (x,f(x)) in the plane. Typically, the graph of such a function is a curve. For functions of two variables, the graph is a set of points  (x,y,f(x,y)) in three-dimensional space. For this reason, visualizing functions of two variables is usually more difficult.

One of the most valuable services provided by computer software such as Maple is that it allows us to produce intricate graphs with a minimum of effort on our part. This becomes especially apparent when it comes to functions of two variables, because there are many more computations required to produce one graph, yet Maple performs all these computations with only a little guidance from the user.

Two common ways of representing the graph of a function of two variables are the surface plot and the contour plot. The first is simply a representation of the graph in three-dimensional space. The second, draws the level curves f(x,y)=C for several values of C in the x,y -plane. We will explore how to produce these kinds of graphs in Maple, and how to use the graphs to study the functions.

Maple Commands, with Examples

You can define functions of more than one variable in much the same way as you defined functions of a single variable:

> f := (x,y) -> x^2 + y^2;
> f(3,-1);
> g := (a,b,c,d,e) -> a*b^2 - sin(c+d)/e;

The following commands are useful for working with functions of two variables in Maple.

Exercises

1.
a.
Generate a surface plot and contour plot for each of the following functions on the given domains:
i.
f(x,y) = x/(1+x2+y2), on $-3\leq x\leq 3$;$-3\leq y\leq 3$.

ii.
$g(x,y) = \sin(x)\sin(y)$, on $0\leq x\leq 2\pi$; $0\leq y\leq 2\pi$.

iii.
$Q(s,t) = \tan^{-1}(4t-s^2)$, on $-2\leq s\leq 2$; $-2\leq t\leq 2$.
b.
What does the contour plot look like in the regions where the surface plot has a steep incline? What does it look like where the surface plot is almost flat?
c.
What can you say about the surface plot in a region where the contour plot looks like a series of nested circles?
2.
Write a function of x and y whose level curves are sine-wave shaped. (A contour plot of such a function is below.)

\includegraphics [height=3in,angle=-90]{contourplot.ps}

Create a surface plot and contour plot for your function.

3.
Recall that we say that the limit of a function of two variables exists only if the limiting value is the same on all possible path going to the point. Consider the function

\begin{displaymath}
f(x,y) = \frac{x^2+y^3}{x^2+y^2}. \end{displaymath}

Explain why f(x,y) does not have a limit at (0,0). Hint: Consider the surface plot of this function near (0,0). Then choose two distinct paths that approach (0,0) and show that the limit is different or each path.

Perform a similar study for the function

\begin{displaymath}
g(x,y)=\frac{x^2y}{x^4+y^2}
 \end{displaymath}

Is there a limit at (0,0)? If so, what is the value of the limit?

4.
For the function $f(x,y) = \frac{2xy}{1+x+y}$ and the point P(2,3),
a.
Illustrate how the surface plot gets more and more like a plane if you plot ever smaller regions around the point P. Find the equation of that plane.
b.
Write the equation of the plane in the form z=g(x,y). What are the partial derivatives of g? What are the partial derivatives of f at the point (2,3)? Explain the relationship.


 
next up previous
Next: About this document ...

Christine M Palmer
3/25/1998