Module 11 : Multivariable Calculus
1101 : Multivariable Functions
S E T U P
In this project we will use the following command packages. Type and execute this line before begining the project below. If you re-enter the worksheet for this project, be sure to re-execute this statement before jumping to any point in the worksheet.
> restart; with(plots):
Warning, the name changecoords has been redefined
___________________________________________________________________________________
A. Define a Funciton of 2 Variables
___________________________________________________________________________________
Note that you can evaluate the function with....
numbers, variables, or expressions which can be simplified.
> f := (x,y) -> x/ (x^2 + y^2);
> f(1,2);
> f(2,1);
> f(-3,0);
> f(1/2,1/3);
> f(A, -1);
> f(a,b);
> f(b,a);
> f( r +1, s-1);
> simplify(%);
___________________________________________________________________________________
B. Graph a function of 2 Variables
___________________________________________________________________________________
A basic three dimensional graph is accomplished by the plot3d command.
Note that you need to specify three items : the function, the x domain, and the y domain.
> plot3d( x^2 + y^2 - x*y^2 + y*x^2, x = -3..3, y = -3..3);
You can also define the function separately and graph it.
> f := (x,y) -> x^2 + y^2 - x*y^2 + y*x^2;
> plot3d( f(x,y), x = -3..3, y = -3..3);
If you click on the graph, a black frame around the graphic will become visible along with a set of controls in te tool bar at top. If you cllck on the various buttons you will change the appearance of the graph. These changes can also be specified by various options when you give the plot3d command.
> plot3d( f(x,y), x = -3..3, y = -3..3, style = patchnogrid, shading = z, axes = frame);
You can also click on a 3 dimensional graph, and ten while holding the mouse button down drag to rotate the graph in any way. As you rotate the graph, you will see the angles theta and phi( measured in degrees ) in the tool bar in the upper left change according to your mouse movements. You can also specify a viewing anlge i the plot command by using the orientation option.
> plot3d( f(x,y), x = -3..3, y = -3..3, style = patchnogrid, shading = xyz, orientation = [63,-90] , axes = frame);
Another variation is to draw the surface with level curves which indicate paths of equal elevation on te surface.
> plot3d( f(x,y),x = -3..3, y = -3..3, style = patchcontour, contours = 24, axes = boxed);
Another option is to create a contour plot which indicates is much like the elevation lines you might see on a map of a mountainous region. These are the sample contours seen above with the patchcontour style. However, this is a two dimensional representation of the three dimensional surface.
> contourplot( f(x,y), x = -3..3,y = -3..3, contours = 25);
Planes
The graph of a linear equation in x, y and z is a plane. However, to graph the plane, you need to express it as a function z = f(x, y ).
> 3*(x-2) + 5*(y+1) - 3*(z-2) =11;
> solve(%,z);
> plot3d( %, x = -5..5, y = -5..5,axes = boxed, style = patchcontour, orientation = [-30,50]);
___________________________________________________________________________________
C. Implicit Function of 3 Variables
___________________________________________________________________________________
Although functions of three variables F(x, y, z) would require four dimensions to graph, express in the form F(x, y, z) = c define an implicit function which can be plotted in three dimensions. While functions of two variable of the form z = f(x, y) are often a sheet blowing in the wind, the shapes defined by iimplict funtions can be much more complicated.
The unit sphere
> with(plots):
> implicitplot3d( x^2 + y^2 + z^2 = 1, x = -1..1, y = -1..1, z = -1..1, axes = boxed, style = patchcontour, scaling = constrained, shading =z);
Here is a more interesting shape.
> implicitplot3d( x^2 - y^2 + z^2 = 1/2, x = -1..1, y = -1..1, z = -1..1, axes = boxed, style = patchcontour, scaling = constrained, orientation = [60,80]);
___________________________________________________________________________________
D. Function of 3 Variables Using A Parameter
___________________________________________________________________________________
When a system of three parametric equations x = f(t), y = g(t) , z = h(t) the result is curve in the three dimensional space. The form is to use the spacecurve comand with an ordered triple with [f(t), g(t), h(t)] and a range of values for the parameter t.
When f, g, and h are linear functions, the result is a line in three dimensions.
> spacecurve([t, 3*t - 5, 2 - 7*t ], t = 0..4, axes = boxed, orientation = [-30, 80]);