Homework 01 Solutions
Math 21a
Spring, 2014
1. (Stewart 11.1 #35-40 ) Match the functions given in the textbook with their graphs and with their contour maps shown
on page 748 in the text. Explain in a few sentences how you know which graph and contour plot match to each function.
Solution:
The answer is
35. C & II,
36. A & IV,
(A) IV, 36,
(B) VI, 39,
37. F & I,
38. E & III,
39. B & VI,
(D) V, 40,
(E) III, 38,
40. D & V
or
(C) II, 35,
(F) I, 37.
Questions of this sort can be hard and time-consuming. The key is to find as many symmetries as you can. It is usually
easier to start from the 3D plot. A good way to start is to ask yourself if the graph has any sinusoidal oscillations. If
so, then you know sin or cos appear somewhere in the function.
It is clear that (A), (C), (E), (F) have sinusoidal oscillations and hence their functions must come from (35)–(38).
• The oscillations in (A) appear in the y-direction with amplitudes increasing as x increases, which is only satisfies
by the equation in problem 36: z = ex cos y. It is periodic in y but not in x, so its contour plot is (IV).
• The level curves of (F) are parallel straight lines, so the contour plot of (F) is (I). The value of the function depends
only on x − y, hence it corresponds to the equation in 37: z = sin(x − y).
• Both (C) and (E) oscillate in both x- and y-directions. As x increases, the frequency stays the same for (E) but
increases for (C). Therefore (C) is the graph of problem 35: z = sin(xy) and (E) is the graph of problem 38:
z = sin x − sin y. It is clear that the contour plot of (E) is (III). The level curves for z = sin(xy) are hyperbolas,
hence the contour plot for (C) is (II).
How to distinguish between (B) and (D)? Notice (D) has a little hill, a little dent and flattens out as x and y become
x−y
large. Therefore it is the graph of the equation in problem 40: z = 1+x
2 +y 2 with contour plot (V). This leaves (B) with
2
2
(VI) and problem 39: z = (1 − x )(1 − y ) which grows large as x, y grow large.
Warning: It is easy to confuse (II) with (VI) and conclude incorrectly that (II) is the contour plot for (B). One way
to NOT fall in the trap is to realize that the curves in (II) are hyperbole. Another way to note that the level curves
become close to each other as x increases in (II).
2. In this problem, we’ll use Mathematica to tackle (Stewart 11.1 #48 ). The purpose of this exercise is twofold: first, we’d
like you to be able to answer part (f) by considering the plots you make in (a)-(e); second, we want you to start to get
familiar with using Mathematica so that you can use it to help you visualize graphs and surfaces and curves in R3 . In
Math 21a you are not responsible for knowing how to code in Mathematica for any of the exams. For this question, you
may either print out your Mathematica plots or sketch what you see on the screen.
p
(a) Plot the function f (x, y) = x2 + y 2 by using the following Mathematica command:
Plot3D[Sqrt[x^2+y^2], {x,-5,5}, {y,-5,5}]
Once you hold “Shift” and hit “Enter”, a plot will appear. With your computer’s mouse, you can click and drag
on the plot to rotate the view of the graph of f . Try this. Notice that this is the graph of a cone. “Wait! ” you say,
“isn’t the top of a cone a circle? ” Explain why the Mathematica output has a top that is sort of a curvy square.
Solution:
This is what Mathematica shows us when we type in the given command:
Mathematica cuts off the graph at the traces x = −5, x = 5, y = −5, y = 5, which are all curvy. They are in fact
arcs of circles.
√
2
2
(b) Plot the function f (x, y) = e x +y by using the Mathematica command:
Plot3D[Exp[Sqrt[x^2+y^2]], {x,-5,5}, {y,-5,5}]
The plot looks like it has folded corners because the exponential function grows so fast that Mathematica decided
you would probably rather not see the really tall bits so that the rest could be shown in more detail.
Solution:
This is what Mathematica shows us when we type in the given command:
You can see the “folded corners” mentioned in the question.
p
(c) Plot the function f (x, y) = ln( x2 + y 2 ) by modifying the command above appropriately. The Mathematica
command for the natural logarithm is Log[ ]. Why do you think the plot looks so strange near (x, y) = (0, 0)?
Solution: This is what Mathematica shows us when we type in the command Plot3D[Log[Sqrt[x^2+y^2]],
{x,-5,5}, {y,-5,5}]
The plot p
looks strange near the origin because there is a black hole there warping
space-time. (More prosaicly, the
p
function x2 + y 2 decreases to zero as we approach the origin, and so ln( x2 + y 2 ) decreases without bound.)
The function ln is not defined at 0.
p
(d) Plot the function f (x, y) = sin( x2 + y 2 ).
Solution:
This is what Mathematica shows us when we type in the given command:
(e) Plot the function Sqrt[Sqrt[x^2+y^2]].
Solution:
Another Mathematica plot:
By this point you should be playing with Mathematica. For example, grab the image, twist it about and view the
picture from different angles.
p
(f) In general, if g is a function of one variable, how is the graph of f (x, y) = g( x2 + y 2 ) related to the graph of g?
Hint: What are the level sets of all the functions above? How do the plots in √
(a), (b), (c), (d) and (e) relate to
the plots of the functions g(t) = t, g(t) = et , g(t) = ln t, g(t) = sin t and g(t) = t, respectively?
p
Solution: The graph of f (x, y) = g( x2 + y 2 ) can be obtained from the graph of g by graphing z = g(x) in the
xz-plane and rotating the curve about the z-axis. This means that the level sets are circles (possibly more than
one at each level).
3. (Stewart 11.1 #15-18 )
(a) In each problem, a contour map of a function f is shown in the textbook. Use it to make a rough sketch of
the graph of f .
(b) (Extra Credit – These may be hard.) Find a formula for a function f (x, y) whose contour plot has features
that match the contour plot given. For experimenting with the extra credit part, you might want to try to
use Mathematica’s ContourPlot command. For example, the contours of f (x, y) = x2 − y 2 can be generated
by:
ContourPlot[x^2-y^2, {x,-5,5}, {y,-5,5}]
or try it with some extra options:
ContourPlot[x^2-y^2, {x,-5,5}, {y,-5,5}, ContourShading->None, ContourLabels->Automatic]
Solution:
p
15. The level curves are circles and become more separated as z increases. One can take fp(x, y) = g( x2 + y 2 )
where g(x) is a function of one variable that is concave down. For example f (x, y) = ( (x2 + y 2 ) + 1)1/6 .
16. The level curves are parabolas opening up that get closer together as z increases. This means the x-traces z =
f (k, y) are decreasing and concave up functions in y. An example would be f (x, y) = x2 −ln(y +3)+8, y ≥ −2.
17. The level curves are symmetric about the line x = y. This suggests the function f (x, y) is symmetric in x, y.
The level curves also look like sheered hyperbolas. An example would be f (x, y) = xy(x − y)2 . The square
there is just to make it symmetric in x, y. Can you guess without consulting Mathematica what the level
curves for the graph of f (x, y) = xy(x − y) look like?
18. The level curves are slanted squares with equal separation. Whenever you see these kinds of corners, think
|x|. Whenever you see equal separations, think linear. In this case, an example would be f (x, y) = 3 − |x| − |y|.
Here are some Mathematica sketches:
15. z = (
p
x2 + y 2 + 1)1/6
16. z = x2 − ln(y + 3) + 8
17. z = xy(x − y)2
18. z = 3 − |x| − |y|
4.
(a) Draw and label a level curves diagram (contour map) of the function f (x, y) = 1 + 9x2 + y 2 . Please label the axes
and at least three contours.
(b) Draw a rough sketch of the function. You should feel free to check your work in (a) using the ContourPlot
command, and your work in (b) using the Plot3D command.
Solution:
Shown here are a few labeled contours and a sketch of the function in space, courtesy of Mathematica:
5. (Stewart 9.1 #42 ) Describe and sketch a solid with the following properties. When illuminated by rays parallel to the
z-axis, its shadow is a circular disk. If the rays are parallel to the y-axis, its shadow is a square. If the rays are parallel
to the x-axis, its shadow is an isosceles triangle.
Solution: This is describing a modern tube of toothpaste standing on its cap end. The cap is circular (allowing it
to stand), so when standing the shadow below the tube is a circle. Viewed so the side is fully viewable, the tube looks
rectangular. Viewed perpendicular to the vertical side, the tube casts a triangular shadow.
6. Polar coordinates check.
(a) Plot the point whose polar coordinates are given. Then find the Cartesian coordinates of the same point.
)
(ii) (3, π4 )
(i) (4, 2π
3
Solution:
Here’s a picture with the two points in question:
The first point is
√
(4 cos(2π/3), 4 sin(2π/3)) = (−2, 2 3) ≈ (−2, 3.464)
and the second is
3 cos( π4 ), 3 sin(π/4) =
3
3
√ ,√
2
2
≈ (2.121, 2.121).
(b) Shade the region in the plane that is described by the polar equations 1 < r ≤ 4 and
π
2
≤θ<
7π
.
6
Solution: This is part of an annular region and includes two of its boundaries (solid) and not the other two
(shown dashed):
© Copyright 2026 Paperzz