Several Variables

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

Distance to the origin

Here, the function z = f(x, y) is the distance from the origin to the point (x, y), plotted as a surface in 3D.

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

Here’s the corresponding contour plot in 2D.

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

Here’s the 3D surface again, but with a manipulator that shows you the curve that results when you slice the surface with a vertical plane.

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}]

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}]

Miscellaneous example

Probably you should start with the contour plot on this one, then build it out of Play-Doh, then check your answer against the other plots.

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

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

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}]

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}]

Cobb-Douglas production model

This is the model of Cobb and Douglas, which relates labor expenditures L and capital expenditures K to production P. 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

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}]