Graphing functions of several variables
In studying single-variable functions, we have seen that plotting a graph often displays the important features of a function from which we can obtain useful information. Graphs are also useful for visualising functions of two variables. Consider a single-variable function, and a two-variable function, . In the same way that an equation leads to plotting ordered pairs in the Cartesian plane (see Fig. [1.1), the equation, leads to plotting ordered triples in a three-dimensional space (see Fig. 1.2). We can extend this to functions of three variables, e.g. to represent four-dimensional surfaces.
Figure 1.1: Graph of for .
Plotting functions of two variables by hand is often a tedious and difficult task; fortunately we rely on computer software (e.g. MATLAB) which allows us to explore functions graphically from different perspectives. Of course it is not possible to draw the graph of a function of more than two variables.
Before we move on, let us briefly discuss the domain, of functions of more than one variable. Recall for a single-variable function, say , the domain consists of all the values of that we can plug into the function and get back a real number. This implies that the domain of a function of a single variable is an interval (or intervals) of values from the number line or one-dimensional space. For a two-variable function, say , the domain is given by a two-dimensional space consisting of all the coordinate
Figure 1.2: Graph of for .
pairs, that we can plug into the function and get back a real number. If we are given a function and the domain is not specified, then it is understood that the domain of is the set of all pairs for which is a well-defined number.
Example 1.1 Find the domain of the following function and evaluate :
Solution The expression for gives a real number if the denominator is not 0 and if the quantity under the square root is nonnegative 1
The denominator is not equal to 0 if and hence, the points on the line must be excluded from the domain. For the numerator, since , then the inequality describes the points that lie on or above the line . The domain of is given by:
Finally, to evaluate , we plug in and in the expression for :
note that the term nonnegative is used for a quantity which is either zero or positive, i.e, . Next, in order to analyse graphs, we define and discuss traces and contour maps.
Traces
Traces are the curves which are obtained by intersecting the graph with planes parallel to a coordinate plane. We define three types of traces:
- Horizontal trace at height : the intersection of the graph with the horizontal plane , consisting of points such that (see Fig. 1.31)
- Vertical trace in the plane : the intersection of the graph with the vertical plane at [see Fig. 1.4(a)
- Vertical trace in the plane : the intersection of the graph with the vertical plane at [see Fig. 1.4(b)
Figure 1.3: Graph of intersecting with the horizontal plane at .
Contour maps
The level curve of a function, is defined as the curve in the -plane with equation , i.e. it shows where the graph of has height . A collection of such curves is called the contour diagram or contour map of the function . It is useful to look at the relationship between level curves and horizontal traces. The level curves are the traces of the graph in the horizontal plane, projected down to the -plane. Figure 1.5 shows a number of horizontal traces and their projections on the -plane; as an example a horizontal plane is highlighted at while the dotted,
Figure 1.4: Vertical traces parallel to (a) -plane with trace shown with a thick red line at (b) -plane with trace shown with a thick red line at .
vertical lines show the ptojection of that trace to the level curve on the -plane.
Figure 1.5: Horizontal traces and level curves at various values of . A horizontal plane and trace are highlighted at with the projected level curve shown at on the -plane. Example 1.2 Sketch the level curves for of the function
Solution The level curves are given by or, equivalently,
These curves represent concentric circles with centre at and radius . Figure 1.6 shows the level curves at (labelled).
Figure 1.6: Contour map of showing level curves for .