Functions of several variables

Multivariable Calculus, Math 211, Carleton College, Fall 2023, Joshua R. Davis, jdavis@carleton.edu

Miscellaneous example

Here’s a 3D plot.

Clear[x, y];
z = x^2 Sin[y];
Plot3D[z, {x, -1, 1}, {y, - 2Pi, 2 Pi}]

Here’s a contour plot.

ContourPlot[z, {x, -1, 1}, {y, - 2Pi, 2 Pi}]

This manipulator helps you visualize slices of the form x = a.

Manipulate[
Show[
Plot3D[z, {x, -1, 1}, {y, -2 Pi, 2 Pi}], 
ParametricPlot3D[{a, t, z /. {x -> a, y -> t}}, {t, -2 Pi, 2 Pi}, PlotStyle -> Thick]], 
{a, -1, 1}]

This manipulator helps you visualize slices of the form y = b.

Manipulate[
Show[
Plot3D[z, {x, -1, 1}, {y, -2 Pi, 2 Pi}], 
ParametricPlot3D[{t, b, z /. {x -> t, y -> b}}, {t, -1, 1}, PlotStyle -> Thick]], 
{b, -2 Pi, 2 Pi}]

Volume of a cylinder

This example is about a cylinder of length L and radius R (rendered in Mathematica as l and r). Again we do 3D surface, 2D contour plot, and 3D slicing.

Clear[l, r];
v = Pi l r^2;
Plot3D[v, {l, 0, 2}, {r, 0, 2}]

ContourPlot[v, {l, 0, 2}, {r, 0, 2}]

Manipulate[
Show[
Plot3D[v, {l, 0, 2}, {r, 0, 2}], 
ParametricPlot3D[{a, t, v /. {l -> a, r -> t}}, {t, 0, 2}, PlotStyle -> Thick]], 
{a, 0, 2}]

Manipulate[
Show[
Plot3D[v, {l, 0, 2}, {r, 0, 2}], 
ParametricPlot3D[{t, b, v /. {l -> t, r -> b}}, {t, 0, 2}, PlotStyle -> Thick]], 
{b, 0, 2}]

Distance to the origin

Here, the function z = f(x, y) is the distance from the origin to the point (x, y).

Clear[x, y];
z = Sqrt[x^2 + y^2];
Plot3D[z, {x, -1, 1}, {y, -1, 1}]

ContourPlot[z, {x, -1, 1}, {y, -1, 1}]

Manipulate[
Show[
Plot3D[z, {x, -1, 1}, {y, -1, 1}], 
ParametricPlot3D[{a, t, z /. {x -> a, y -> t}}, {t, -1, 1}, PlotStyle -> Thick]], 
{a, -1, 1}]

Cobb-Douglas production model

In economics, the Cobb-Douglas production model expresses production P as a function of labor expenditures L and capital expenditures K. The constants alpha and beta are empirically derived from economic data from 1899 to 1922.

Clear[l, k];
alpha = 0.75;
beta = 1.01;
p = beta l^alpha k^(1 - alpha);
Plot3D[p, {l, 0, 2}, {k, 0, 2}]

ContourPlot[p, {l, 0, 2}, {k, 0, 2}]

Manipulate[
Show[
Plot3D[p, {l, 0, 2}, {k, 0, 2}], 
ParametricPlot3D[{a, t, p /. {l -> a, k -> t}}, {t, 0, 2}, PlotStyle -> Thick]], 
{a, 0, 2}]

Manipulate[
Show[
Plot3D[p, {l, 0, 2}, {k, 0, 2}], 
ParametricPlot3D[{t, b, p /. {l -> t, k -> b}}, {t, 0, 2}, PlotStyle -> Thick]], 
{b, 0, 2}]

Limit example

Here’s a delicate example that motivates some of our later work with limits.

z = x^y;
Plot3D[z, {x, 0, 1}, {y, 0, 1}]

ContourPlot[z, {x, 0, 1}, {y, 0, 1}]

Manipulate[
Show[
Plot3D[z, {x, 0, 1}, {y, 0, 1}], 
ParametricPlot3D[{a, t, z /. {x -> a, y -> t}}, {t, 0, 1}, PlotStyle -> Thick]], 
{a, 0, 1}]

Manipulate[
Show[
Plot3D[z, {x, 0, 1}, {y, 0, 1}], 
ParametricPlot3D[{t, b, z /. {x -> t, y -> b}}, {t, 0, 1}, PlotStyle -> Thick]], 
{b, 0, 1}]

Here’s a question to ponder: If 0^y = 0 for almost all values of y, and x^0 = 1 for almost all values of x, then what is 0^0?

Topography

Over a small region of the Earth, the surface of the Earth can be approximated as the x-y-plane, and elevation is a function z = f(x, y). A contour plot of elevation is called a topographic map. Here’s one constructed from elevation data around Crater Lake, Oregon, USA.

elevations=GeoElevationData[
GeoBoundingBox[GeoDisk[LinguisticAssistant,LinguisticAssistant]],
Automatic,"GeoPosition",GeoZoomLevel->10];
GeoContourPlot[elevations]

Similarly, in weather reports one often sees contour plots of air temperature and atmospheric pressure.