Curves and Surfaces in (ℝ^3): Contour Plots & Space Curves

Practice Problems relating to contour plots. Solutions are provided.

Initialization Cell

$TextStyle={FontFamily->"Times",FontSize->16,Background->None}
Off[General::spell1]

f[x_,y_]=1/(1+x^2+y^2);
plt1=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt1a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->40,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

f[x_,y_]=-Abs[x y];
plt2=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt2a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->40,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

f[x_,y_]=(x^2-y^2)^2;
plt3=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt3a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->40,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

f[x_,y_]=Sin[x + y];
plt4=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt4a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

f[x_,y_]=Abs[x]+Abs[y];
plt5=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt5a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

f[x_,y_]=(x-y)^3;
plt6=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt6a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

q1a=Show[GraphicsGrid[{{plt1,plt2,plt3},{plt4,plt5,plt6},{plt2a,plt3a,plt6a},{plt4a,plt1a,plt5a}}],ImageSize->{800,Automatic},DisplayFunction->$DisplayFunction]

f1[x_,y_]=Sin[Sqrt[x^2+y^2]];
f2[x_,y_]=1/(x^2+4y^2);
f3[x_,y_]=Sin[x] Sin[y];
f4[x_,y_]=x^2 y^2 Exp[-x^2-y^2];
f5[x_,y_]=x^3 - 3 x y^2;
f6[x_,y_]=Sin[x]^2 + y^4/4;

plt1=Plot3D[f1[x,y],{x,-10,10},{y,-10,10},AxesLabel->{"x","y","z "},PlotPoints->30,Ticks->None,DisplayFunction->Identity];
plt1a=ContourPlot[f1[x,y],{x,-10,10},{y,-10,10},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

plt2=Plot3D[f2[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},PlotRange->{0,50},PlotPoints->30,Ticks->None,DisplayFunction->Identity];
plt2a=ContourPlot[f2[x,y],{x,-2,2},{y,-2,2},PlotPoints->40,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

plt3=Plot3D[f3[x,y],{x,-5,5},{y,-5,5},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt3a=ContourPlot[f3[x,y],{x,-5,5},{y,-5,5},PlotPoints->40,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

plt4=Plot3D[f4[x,y],{x,-3,3},{y,-3,3},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt4a=ContourPlot[f4[x,y],{x,-3,3},{y,-3,3},PlotPoints->40,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

plt5=Plot3D[f5[x,y],{x,-7,7},{y,-7,7},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt5a=ContourPlot[f5[x,y],{x,-7,7},{y,-7,7},PlotPoints->40,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

plt6=Plot3D[f6[x,y],{x,-7,7},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None,DisplayFunction->Identity];
plt6a=ContourPlot[f6[x,y],{x,-7,7},{y,-2,2},PlotPoints->40,FrameLabel->{"x","y"},FrameTicks->None,DisplayFunction->Identity];

q2a=Show[GraphicsGrid[{{plt1,plt2,plt3},{plt4,plt5,plt6},{plt2a,plt3a,plt6a},{plt4a,plt1a,plt5a}}],ImageSize->{800,Automatic},DisplayFunction->$DisplayFunction]

Problem 1

Match the following sketches with its contour plot (Hit shift enter and you will be prompted to evaluate initialization cells, to which you should choose yes; it may take a few minutes to create the plots)

Show[q1a]

Barry's Solution

f[x_,y_]=1/(1+x^2+y^2)
plt1=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None]
plt1a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

f[x_,y_]=-Abs[x y]
plt2=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None]
plt2a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

f[x_,y_]=(x^2-y^2)^2
plt3=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None]
plt3a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

f[x_,y_]=Sin[x + y]
plt4=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None]
plt4a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

f[x_,y_]=Abs[x]+Abs[y]
plt5=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None]
plt5a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

f[x_,y_]=(x-y)^3
plt6=Plot3D[f[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None]
plt6a=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

q1a=Show[GraphicsGrid[{{plt1,plt2,plt3},{plt4,plt5,plt6},{plt2a,plt3a,plt6a},{plt4a,plt1a,plt5a}}],ImageSize->{800,Automatic}]

Problem 2

Match the function with its graph and contour plot.

f1[x_,y_]=Sin[Sqrt[x^2+y^2]]

f2[x_,y_]=1/(x^2+4y^2)

f3[x_,y_]=Sin[x] Sin[y]

f4[x_,y_]=x^2 y^2 Exp[-x^2-y^2]

f5[x_,y_]=x^3 - 3 x y^2

f6[x_,y_]=Sin[x]^2 + y^4/4

The following command will produce the plots:

Show[q2a]

Barry's Solution

plt1=Plot3D[f1[x,y],{x,-10,10},{y,-10,10},AxesLabel->{"x","y","z "},PlotPoints->30,Ticks->None]
plt1a=ContourPlot[f1[x,y],{x,-10,10},{y,-10,10},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

plt2=Plot3D[f2[x,y],{x,-2,2},{y,-2,2},AxesLabel->{"x","y","z "},PlotRange->{0,50},PlotPoints->30,Ticks->None]
plt2a=ContourPlot[f2[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

plt3=Plot3D[f3[x,y],{x,-5,5},{y,-5,5},AxesLabel->{"x","y","z "},Ticks->None]
plt3a=ContourPlot[f3[x,y],{x,-5,5},{y,-5,5},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

plt4=Plot3D[f4[x,y],{x,-3,3},{y,-3,3},AxesLabel->{"x","y","z "},Ticks->None]
plt4a=ContourPlot[f4[x,y],{x,-3,3},{y,-3,3},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

plt5=Plot3D[f5[x,y],{x,-7,7},{y,-7,7},AxesLabel->{"x","y","z "},Ticks->None]
plt5a=ContourPlot[f5[x,y],{x,-7,7},{y,-7,7},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

plt6=Plot3D[f6[x,y],{x,-7,7},{y,-2,2},AxesLabel->{"x","y","z "},Ticks->None]
plt6a=ContourPlot[f6[x,y],{x,-7,7},{y,-2,2},PlotPoints->30,FrameLabel->{"x","y"},FrameTicks->None]

q2a=Show[GraphicsGrid[{{plt1,plt2,plt3},{plt4,plt5,plt6},{plt2a,plt3a,plt6a},{plt4a,plt1a,plt5a}}],ImageSize->{800,Automatic}]

Problem 3

If the function V(x,y) is the electric potential at a point (x,y) in the x y plane, then the contour plot of V has lines which are equipotential curves because at all the points on the curve the electric potential is the same.

Sketch some equipotential curves if V(x,y) = 1/(Sqrt[10-(x^2)-(y^2)]). You might also want to sketch the function using Plot3D if you have difficulty generating the equipotential curves.

Your Solution

Barry’s Solution

V[x_,y_]=1/Sqrt[10-x^2-y^2]
ContourPlot[V[x,y],{x,-2,2},{y,-2,2}]
Plot3D[V[x,y],{x,-2,2},{y,-2,2}]

Problem 4

A thin metal plate, located in the x y plane, has a temperature T(x,y) at the point (x,y). The contour plot of T has lines which are isothermals because at all the points on the curve the temperature is the same.

Sketch some isothermals if T(x,y) = 100/(Sqrt[1+(x^2)+2(y^2)]). You might also want to sketch the function using Plot3D if you have difficulty generating the equipotential curves.

Your Solution

Barry's Solution

T[x_,y_]=100/Sqrt[1+x^2+4y^2]
ContourPlot[T[x,y],{x,-2,2},{y,-2,2},PlotPoints->40]
Plot3D[T[x,y],{x,-2,2},{y,-2,2}]

Problem 5

Sketch the two curves using Plot3D. Find the space curve that describes the line for which the two surfaces f and g intersect. Try to plot it as well!

f[x_,y_]=4-x^2-y
g[x_,y_]=3-3y

Your Solution

Barry's Solution

Here are the 3D plots. I turned the Mesh off on one so it is easy to see the intersection.

plt1=Plot3D[f[x,y],{x,-4,4},{y,-4,4},AxesLabel->{"x","y","z"},PlotPoints->30]
plt2=Plot3D[g[x,y],{x,-4,4},{y,-4,4},AxesLabel->{"x","y","z"},PlotPoints->30,Mesh->False]
plt3=Show[plt1,plt2]

We can easily see the intersection line.

The two surfaces interesect where f(x,y)=g(x,y).To plot the space curve, we will need to have a parametric representation of the curve.

f[x,y]==g[x,y]

Combining this equation with the z=f(x,y) and z=g(x,y) equations allows us to find the relationships between x,y,z along the space curve.

Solve[{z==f[x,y],z==g[x,y],f[x,y]==g[x,y]},{x,y,z}]

Now we can do a 3D parametric plot! The parameter is the x.

plt4=ParametricPlot3D[{x,(x^2-1)/2,-3(x^2-3)/2},{x,-4,4},AspectRatio->1,AxesLabel->{"x","y","z"},PlotStyle->{Red,Thick}]

Notice how the space curve is the intersection of the surfaces:

Show[plt3,plt4]