Math 2248 Lab 4:
Contour Plots, and Discontinuous Mixed Partial Derivatives

© Copyright by T.I. Lakoba
Last modified  2025-10-01

Clear["`*"]

Introduction

In Lab 3, you saw that one way to get a good idea of what a surface z = f(x,y)  looks like is to consider its traces at the intersections with planes z = constant,  x= constant,  and y = constant.  

When you slice the surface by planes  z = k  with different values of  k, you obtain level curves. These are the curves, plotted each in its own plane z = k, where the values of x and y  satisfy  f(x,y) = k. If you were walking on the surface along one of these curves, your height above the xy-plane remains constant, i.e., your path remains level; hence the name. 

Collections of level curves, all projected into the  xy-plane, are called contour plots, or contour maps, of the surface. This is exactly the sort of plot you see in a topographic map, where the altitude of the terrain is indicated by showing the level curves where the height is the same. 

Mathematica has built-in commands for making contour plots. For example, a contour plot of a paraboloid   z =  (x^2) + (y^2)  is obtained as follows:

ContourPlot[  x^2 + y^2  , {x,-8,8}, {y,-8,8},Contours->20,PlotRange->All]

A few comments about this plot are in order:

(i)  By convention, the contours correspond to the planes which are equidistant along the  z-direction. For example, the first, second, and third contours counted from the center of the above plot correspond to the planes  z=k1,  z=k2, and  z=k3  where   k2 - k1 = k3 - k2 = Δ k. To find theses values, hover the cursor over the three inner-most contours in the above plot. 

Now, on a piece of paper, verify that 
 (kmax - kmin)/ Δ k + 1 = number of the Contours declared in the ContourPlot command. Here  kmax  and  kmin  are the k-values of the outer- and inner-most contours.

If need be, one can control the values of  k  for which the contours are drawn. For example, the next command draws the contours for  k = 1, 22, and 95:

ContourPlot[  x^2 + y^2  , {x,-8,8}, {y,-8,8},Contours->{1,22,95},PlotRange->All]

One can also draw contours at values defined in a list (which in Mathematica is created with the command Table):

ContourPlot[  x^2 + y^2  , {x,-8,8}, {y,-8,8},Contours->Table[k,{k,1,99,7}],PlotRange->All] 
(* If you are not sure what the numbers "1,99,7" stand for, look up Help for the Table command, or simply hover the cursor over the contours in the plot.*)

Note that you will  not  need to specify contours in such fancy ways in this Lab, but instead will need to simply specify their number, as in the very first example above.

(ii)  The height of the surface is indicated in the contour plot by the degree of the shading and by the color, with the lighter shading corresponding to higher elevation levels. This fact will be used extensively in this Lab. 
By examining the contour plot of the paraboloid, answer on your own:  
Which colors, bluish or brown-yellowish, correspond to higher elevation levels?
This fact will also be used extensively in this Lab.

(iii)  PlotRange -> All option is used to ensure that the contour plot of the entire surface within the specified x- and y-limits, rather than of its chopped version, is plotted. This option is not needed in all cases, but it is a good idea to always include it just to avoid a misleading-looking plot. 

(iv)  If you ever need to learn more about the ContourPlot command (or about any other command), go to “Help” in the main menu bar, click on the “Documentation Center”, and enter the command’s name in the search field.

Recall from Sec. 14.1 (see the class notes and ## 36, 37, 41 in the Homework) that a varying density of the level curves indicates a varying slope of the original surface. 

Practice on your own:
From the above plot, can you tell if the surface gets steeper or gentler away from the origin? (Review the end of posted notes for Sec. 14.1 if you forgot how to tell these cases part.) 

Practice on your own: 
Now make a contour plot of a cone  z = (Sqrt[ (x^2) + (y^2) ]) and tell, from the behavior of its level curves, whether this surface’s slope increases or decreases away from the origin. (If you are not sure, find the answer in a homework problem, or deduce it from a Plot3D of the cone.)

Just FYI, here is another commands related to contour plotting:

DensityPlot[ x^2 + y^2  , {x,-8,8}, {y,-8,8}, PlotRange->All]

Again, this is just a fancy command. You will not need to use it in this Lab.

The purpose of this Lab is to show that contour plots can be quite useful for visualizing the behavior of both continuous and discontinuous functions of two variables. Exercise 1 will deal exclusively with continuous functions, while in Exercise 2 some functions will be continuous and some, discontinuous. An Example showing how to interpret contour plots of discontinuous functions will be presented before Exercise 2. In the 2nd Bonus Exercise, you will further explore the use of contour plots for visualizing discontinuous functions. 

Note that at any point of your work, you may make a 3D plot of the surface at hand to verify that your answers are correct. (Use the Plot3D command for that.) However, the written justification for your answers must come from contour plots.

Exercise 1

(a)  Make a contour plot of the surface

                  z  =  x  exp ( -( (x^2) + (y^2) ) )
                  
Clarification:  
“exp(f(x))” means (e^(f(x))). It is commonly used when  f(x)  has a lengthy expression, which to some extent is true about  -((x^2) +(y^2)).    (e^(f(x)))  can be entered in Mathematica in two ways: 
(1) - as  E^(f(x))   or  (e^(f(x))),  where the fancy  e  is taken from the Basic Math (or Classroom) Assistant palette, or  
(2) - as  Exp[f(x)].  
Again, if the expression for  f(x)  is not anything short, it is better to use the second method.
Also, recall that you should use either the space or the asterisk between  x  and  exp  to denote their product. 

In your contour plot, use the range  [-2,2] for x and y  and set the number of contours to 10. Keep this number of contours throughout this Lab unless otherwise noted.

From your plot, determine whether the peak (as opposed to a well) of this surface is on the right or on the left of  x=0. If you are not sure, review the comment made before the sentence in the Introduction typed in bold red. Also, you may hover the cursor over the contours.

Which side of the peak (not of the anti-peak!) is steeper, the right side or the left side?

Now make the contour plot of

			z  =  (x^2)  exp ( -( (x^2) + (y^2) ) )

What is the main qualitative difference of this plot from the previous one? Please answer briefly.  
(Note:  By a qualitative difference, I mean the structural difference between the two surfaces. For example, the presence of an anti-peak instead of a peak, or a different number of peaks or anti-peaks, are qualitative differences. On the contrary, differences in numeric values of the slopes or in the contour shapes, or in the locations of (anti-)peaks, are not qualitative differences.)

(b)  Make a guess which function would give the replica of the first  surface from part (a) rotated by 90 degrees. Make a contour plot of that function. The contour plot, of course, should confirm your guess. 

If you are not sure, experiment, but don’t get carried away: the required change to the function from part (a) is really simple.

Using the results of part (a) above, make a contour plot of a surface with two peaks (i.e., not a peak and an anti-peak) along the  y-axis.

(c)   Consider the function 

			z  =  (((x y))^2)  exp ( -( (x^2) + (y^2) ) ).

   STOP!  Don’t make a plot yet!  Answer the following questions first. 
Using the results of parts (a) and (b), what do you expect this surface to look like? (The specifics I am looking for are in the answer box below.) Answer this question without making any plots; it is about what you expect, not what the plot really looks like! I will grade (lightly) not the correctness of your expectation but your ability to reflect - later - upon your own answer.

Now make a contour plot of that surface.

Does it look like you expected? If yes, say so. If no, describe (briefly) what the differences are.

(d)   Now, your task will be to explain the locations of the (anti-)peaks in the actual plot in part (c) using polar coordinates. Do the following. 

   (i)  Substitute the polar expressions for  x  and  y  into the function of part (c). You will get some function  g(r,θ), where r and θ  (“theta”) are the polar radius and angle.  Simplify the result (do it on paper!) and rewrite it as: 

                                 g(r,θ) = F(r) G(θ),
                                 
 where F(r) depends only on r and G(θ) depends only on  θ.  
 
 Example:  If  z = x y, then the corresponding g(r,θ) = r2 cosθ sinθ, so that in this case  F(r) = r2  and  G(θ) = cosθ sinθ.
 
In the answer box below, write down the explicit forms of  F(r) and G(θ) for the g(r,θ) obtained from the function in part (c):

(ii)  In the first three paragraphs of Section 10.3 of your textbook, or online, find the meanings of the polar radius  r  and angle θ .

(iii)  Make 2D plots (i.e., the “usual”, not Polar or Parametric, plots) of  F(r) versus  r  and of  G(θ) versus θ.  Make sure you choose appropriate ranges for  r  and  θ   in your plots. Here “appropriate” means that:
	- They are to be consistent with the meanings that you wrote above;
	- They should be large enough to show the essential details of the graphs;
	- They should not be too large, i.e. not show redundant information.

Technical note:
Your expression for G(θ) will contain expression like (Sin^2)θ  etc. In Mathematica, they must be typed as  Sin[θ]^2  and NOT as Sin^2[θ].

(iv)  Use the above plot for G(θ)  to explain the number of peaks and their locations in your contour plot in part (c). Namely, answer the questions in the answer box below:

Bonus 1 (5%; no partial credit)
     
The following surface has 2 peaks and 2 anti-peaks:

ContourPlot[ (x^2-y^2)*Exp[-( x^2 + y^2 ) ], {x,-3,3}, {y,-3,3},Contours->10,PlotRange->All]

Use this fact and the expertise you have gained when doing this Exercise to create the contour plot of a surface that has 8 peaks and no anti-peaks.

________________________________________________________________

Before you do the assignment in the next Exercise, study the following 

Example

Its purpose is to show what you should pay attention to when using 3D plots and contour plots to examine discontinuous surfaces. 
Recall that the function
			          z = ((x y)/((x^2)+(y^2)))
was shown in Sec. 14.2 to be discontinuous at the origin. To verify this, plot it using the standard 3D plotting command:

Clear[x,y];
Plot3D[x*y/(x^2+y^2),{x,-1,1},{y,-1,1},Mesh->False,PlotPoints->50,AxesLabel->{"X","Y"," "}]

Explanation of plotting options Mesh and PlotPoints:
	■  The Mesh->False option simply removes the mesh from the surface.
	■  The option PlotPoints determines how many points per direction (i.e., along the x- or y-axis) is used in a 3D plot. If you omit it, Mathematica will by default use fewer than 50 points per direction, and the surface may appear jagged. 
	Practice on your own: 
	Experiment with the above command by changing the value of PlotPoints and see what is happening.


Detection of (dis)continuity of a function of two variables relies on two independent concepts. 
	First, we pick  any curve in the xy-plane  and determine if the limit along this curve at a given point, P, exists. This is a Calculus I concept. 
	Second, we try to examine  all possible curves  passing through P and determine if the limits along all these curves are the same. This is the new concept you have learned in Calculus III. 
	We will apply these concepts to a 3D and a Contour plot of the above function to illustrate how its discontinuity can be detected.
		
	Let us start with the 3D plot, obtained above.  
	Begin by locating the axes labels (i.e. X and Y) and look along the direction  y = x (which is one of the diagonals of the figure box) towards the origin (i.e., point (x=0, y=0)). You see that the surface’s elevation is  z=0.5  (verify!) along this direction, and it does not change along this direction. Thus, the first, Calculus I, concept from above says that the limit of  z  at (x=0, y=0) along the direction y = x exists and equals 0.5.
	Similarly, along the direction  y = - x, the limit of  z  at (x=0, y=0) exists and equals -0.5  (again, verify). It may take just a little extra effort to convince yourself that as you approach the origin along  x=0  or  y=0, your reach the elevation  z=0 at that point. 
	Thus, since you see different elevations of the surface as you approach the origin along different directions, the surface must be discontinuous according to the definition of a (dis)continuous surface studied in Sec. 14.2. This is the second, Calculus III, concept from above.

Let us now practice detecting a discontinuity of the same function,  f(x,y) = (xy)/((x^(2 ))+ (y^2)), from its  Contour plot.   Execute the next command:

ContourPlot[x*y/(x^2+y^2),{x,-1,1},{y,-1,1}]

Place the cursor over any given contour (which is the level curve, where  f(x,y) = const ) and move the cursor towards the origin while trying to stay on the same contour. Expectedly enough, the value of the function at each contour, that Mathematica displays near the cursor, does not change. Thus, the limit along any one contour exists (and equals the value displayed). You have just tested the  Calculus I concept  described earlier.  

Now, move the cursor to a different contour and repeat the step described in the previous paragraph. You will see that the value of the function changes. Thus, the limits at the origin along different curves are different. According to the  Calculus III concept,  our function is discontinuous at the origin. (Note that different values of the function are also manifested by different colors in the plot.)


If need be, one can zero in closer to the origin:

ContourPlot[x*y/(x^2+y^2),{x,-0.1,0.1},{y,-0.1,0.1}]

The features of this particular plot do not appear to be affected by the plotting range.


To conclude this Example, let us look at the contour plot of a function

			g(x,,y) = (((x^2)(y^2))/((x^2)+(y^2))),		
			
which was shown in class to be continuous at the origin:

ContourPlot[x^2*y^2/(x^2+y^2),{x,-0.1,0.1},{y,-0.1,0.1},Contours->40]

Practice on your own:
Use this contour plot and the steps which were used above to analyze the discontinuity of  f(x,y) = (xy)/((x^(2 ))+ (y^2))  from the contour plot,  to find  (lim_((x,y)->(0,0))) g(x,y) .


The following 3D plot should confirm your answer for (lim_((x,y)->(0,0))) g(x,y) :

Plot3D[x^2*y^2/(x^2+y^2),{x,-0.1,0.1},{y,-0.1,0.1},Mesh->False,AxesLabel->{"X","Y"," "}]

Exercise 2

In this Exercise, you will use the contour plot to explore mixed partial derivatives of a function.

Recall that the mixed partial derivatives are equal:

				(Subscript[f,  x y])=(Subscript[f,  y x])
wherever they are both continuous. This statement requires some clarification. Namely, the expressions for  (Subscript[f,  x y])  and  (Subscript[f,  y x])  are always the same. However, as we evaluate this expression at a particular point  ((Subscript[x, 0]),(Subscript[y, 0])), the results of the evaluations are equal if and only if the expression is continuous at this point. Below you will explore this seemingly paradoxical situation.

(a)  Define the function: 

		f(x,y) = ((((  (x-Ry)(R x+y)  ))^2)/((((x-Ry))^2)+ (((Rx+y))^2))),      R=tan ((π/8)) .

Clear[x,y];
R=Tan[Pi/8]
f[x_,y_]=
(*
Note 1:
I have started defining the function for you to make sure that you use the correct syntax. A mistake in the syntax may derail your entire work, which is what I would like to prevent from happening.
Note 2:
In the above formula for f(x,y), terms "Ry" and "Rx" may look to you as "R times y" and "R times x," respectively. They do not look so to Mathematica. Rather, it interprets them as new variables named "Ry" and "Rx". To make them be "R times y" etc., you have two options: 
1) Insert space between R and y: R y, not Ry.
2) Use the asterisk to indicate the multiplication explicitly: R*y. 
I prefer the second option as more error-proof.
*)

Now make its contour plot. (Please read the “Important technical notes” below before you make the plot.)
Self-check: This plot should look as a rotated replica of the function at the end of the Example presented before this Exercise. If it does not, check your expression for f[x,y]. An incorrect definition of f[x,y] will likely significantly mess up your work in the rest of this Exercise. 

Important technical notes:
   1. There are two ways of how you can, in principle, plot a function: 
(i)  you can copy and paste it into your Plot command: 
    e.g., ContourPlot[x+y,{x,-1,2},{y,-2,3}];
or 
(ii)  you can first define a function and then use its name in the Plot command:
    e.g., f[x_,y_]=x+y
            ContourPlot[f[x,y],{x,-1,2},{y,-2,3}].
            
Do NOT use the first method! 
Copy-pasting is an illiterate and error-prone method that you should avoid. 
Instead, use the second method. 
Consult Part 1 of Lab 1 if you experience any difficulty with the required syntax of the Plot command. 
 
   2.  Do  NOT  use “:=” when defining either the function itself or any of its partial derivatives below. Use “=” instead. 
 - One reason was explained in Part 1 of Lab 1. (For the same reason, also do not suppress the Output of your commands with “;” unless specifically asked to do so.)
 - The other reason is that sometimes (and unpredictably, as far as I can tell),  Mathematica  fails  to correctly evaluate partial derivatives when “:=” is used. 
 
     3.  Recall that you must always both define and use the function with its arguments explicitly written. 
     Example 1: 
     f = x^2
     does NOT define a function of x. It defines an expression that contains x. As far as Mathematica is concerned, it canNOT find f[2] (for example), if  f  is defined as above. To find f[2],  f  must be previously defined as a function of x. See Part 1 of Lab 1 (or the Input cell above) if you forgot how to do it. 
     Example 2: 
     If you have earlier defined a function f[x], then plotting it with a command like
     Plot[f[x], {x,...} ...	would be correct,
whereas doing so with
    Plot[f, {x,...} ...		would be wrong.
It may still work occasionally, but either defining or using the function’s name without its arguments (i.e., “f” instead of “f[x]” in this example) may cause unexpected consequences and derail your entire work.

From your contour plot, does there appear to be any discontinuity at the origin? (Review the Example above if you are not sure.)  Answer ‘yes'  or  ‘no'.

Find the expressions for  (Subscript[f,  x ]) , (Subscript[f,  y]) , (Subscript[f,  x y]) , (Subscript[f,  y x]): Go to  "Help" in the main menu, select “Documentation Center”, enter D in the search field at the top, and learn the syntax of that command. It will allow you to find those partial derivatives. 

As explained in the 3rd Important technical note above, define each of these derivatives as functions of  x and y; that is: (i) give names to each of these functions. and (ii) explicitly indicate their arguments (i.e.,  x and y). For example, my notation for the first derivative with respect to  x  would be:
Dxf[x_,y_] = D[f[x,y],x]

   Technical note (= Note 3 above stated again!):  
The syntax  Dxf[x_,y_]=D[f,x] (i.e., if you omit the arguments of f[x,y]) will not work, because Mathematica will interpret the “f” on the right-hand side simply as the letter “f”, not as a function f[x,y]. 


Similarly, define and name second derivatives.
  
Please abide by the “Important technical note” a few lines above about not copy-pasting. Once again: using function names to “deal with” functions is the proper way; copy-pasting expressions is not! 
From this point on (in this and all future labs), if you copy-paste where you should have defined a function and later used its name, your score will be harshly reduced. 


The expressions that you will obtain at this step will look somewhat complicated, so put Simplify[ ... ] around  D[ ... ] on the right-hand sides.

To make sure that the expressions for (Subscript[f,  x y]) and  (Subscript[f,  y x]) are indeed the same, type your equivalent of:

Simplify[Dxyf[x,y]-Dyxf[x,y]]

(Here Dxyf and Dyxf are my notations for the mixed derivatives; you should use the names that you have used for  (Subscript[f,  x y]) and  (Subscript[f,  y x]) .)

(b)   In this part, we will verify that  (Subscript[((Subscript[f,  x ])),  y ])= (Subscript[((Subscript[f,  y ])),  x ]) when they are continuous. We will do so by interpreting these mixed derivatives as rates of change of certain slopes. 

Under this interpretation, (Subscript[f,  x y])=(Subscript[((Subscript[f,  x ])),  y ]). The inner term, ((Subscript[f,  x ])), is the slope of  f(x,y)  along the  x-direction. Then (Subscript[((Subscript[f,  x ])),  y ]) is the rate of change of that slope with respect to  y. A formula for this will be given shortly.

Similarly,  (Subscript[f,  y x])=(Subscript[((Subscript[f,  y ])),  x ]) means the rate of change with respect to  x  of the slope of   f(x,y)  along the  y-direction. 

With this interpretation, it is actually far from obvious that these two rates of change of two different slopes should be equal !

Let us now describe how one can compute the value of  (Subscript[((Subscript[f,  x ])),  y ]). In this part you will do this computation at a point away from the origin, e.g., at  ((Subscript[x, 0]),(Subscript[y, 0]))=(1,3).
The exact formula for this derivative is: 

 (Subscript[((Subscript[f,  x ])),  y ])(1,3 ) = (d/dy)(Subscript[f,  x ])(1,y),   
 where one needs to set  y=3  after the last differentiation.

We will now show how to estimate (i.e., approximate) the y-derivative at y=3 in the above exact formula. This can be done with the rise-over-run formula for the derivative: 
        (d/dy)(Subscript[f,  x ])(1,y)(Subscript[|, y=3])   ≈  (((Subscript[f, x])(1, 3.1) - (Subscript[f, x])(1, 2.9))/(3.1 - 2.9))

The meaning of terms in this formula is described shortly below.

For now, use Mathematica and the expression for  (Subscript[f,  x ]) that you found in part (a) to implement the right-hand side of the above approximate formula. 
Remember to use function names instead of copy-pasting their expressions. For example, if the function name for  (Subscript[f,  x ]) is  Dxf[x,y], type  Dxf[1,3.1]  as the first term in the numerator, etc.

The meaning of the above fraction can be broken down to three steps. 
 1) You select a value for  x  ( x=1  in this case) and compute the rate of change (=slope) of  (Subscript[f,  ])  along the  x-axis (i.e., (Subscript[f,  x ])) at one value of  y  ( y=3.1  in this case).
 2) Then for the same value of  x, you compute the rate of change (again, of  (Subscript[f,  ])) along the  x-axis at a nearby value of  y  ( y=2.9  in this case). 
 3) Finally, you find the rate of change of  (Subscript[f,  x ]) (not that of  (Subscript[f,  ]) !) along the (Subscript[y,  ])-axis (i.e., equivalently, in the (Subscript[y,  ])-direction).   
  Note that you have fixed the value of  x  but are changing the value of  y; in other words, you are “moving along the  y -axis”.

Similarly, one has for the other mixed derivative at the same point:
 
  (Subscript[((Subscript[f,  y ])),  x ])(1,3 ) = (d/dx)(Subscript[f,  y ])(x,3),   
  where one needs to set  x=1 after the last differentiation.
 
Use Mathematica and the expression for  (Subscript[f,  y ]) that you found in part (a) to estimate that derivative from the rise-over-run argument according to: 
        (d/dx)(Subscript[f,  y ])(x,3)(Subscript[|, x=1])   ≈  (((Subscript[f, y])(1.1, 3) - (Subscript[f, y])(0.9, 3))/(1.1 - 0.9))

Please recall my Note about not using copy-pasting.

Compare both estimates with each other and with the exact value of  (Subscript[f,  xy ])(1,3 ), where the latter value is found by using the expression for  (Subscript[f,  x y]) that you obtained in part (a). Ask Mathematica to give you a decimal form for (Subscript[f,  xy ])(1,3 ). (Again, use the functional name of  (Subscript[f,  x y]); do not copy and paste its expression.) If you forgot how to find the decimal form of a number, review section “Assigning names” in Part 1 of Lab 1.

(c)   Now use the same method to verify that  (Subscript[((Subscript[f,  x ])),  y ]) ≠ (Subscript[((Subscript[f,  y ])),  x ]) at the point where these derivatives are not continuous. This occurs at the origin, which is the only point where the denominator of  f(x,y)  and of its derivatives is equal to zero. 

As in part (b), find estimates for (Subscript[((Subscript[f,  x ])),  y ])(0,0 ) and  (Subscript[((Subscript[f,  y ])),  x ])(0,0 ) and record your answers in the box below.

What do your results imply about the continuity of  (Subscript[f,  x y]) and  (Subscript[f,   y x])  at  (0,0)?  Explain your answer briefly.

(d)   Confirm your last conclusion in part (c) by making a contour plot of  (Subscript[f,  x y]) (use the function name for  (Subscript[f,  x y])  that you introduced in part (a)).

From the contour plot, state the approximate values of the expression for  (Subscript[f,  x y]) along the x- and y-axes. Also state how these values are related to the estimates of    (Subscript[((Subscript[f,  x ])),  y ])(0,0 ) and  (Subscript[((Subscript[f,  y ])),  x ])(0,0 ) obtained in part (c).

You are now ready to explain why  (Subscript[(Subscript[f,  xy ])(0,0),  ])≠ (Subscript[f,  yx ])(0,0)  when the expression for  (Subscript[f,  xy ])(x,y),  which is the same as the expression for (Subscript[f,  yx ])(x,y),  is discontinuous at (0,0).

Recall, similarly to part (b), that
 (Subscript[(Subscript[f,  xy ])(0,0),  ])= (Subscript[((Subscript[f,  x ])),  y ])(0,0 ) = (d/dy)(Subscript[f,  x ])(0,y),  
where one sets  y=0  after the last differentiation.  

Based on the above formula, state along which direction (i.e., which axis) one needs to approach (0,0) in order to evaluate (Subscript[(Subscript[f,  xy ])(0,0),  ])from the expression for (Subscript[f,  xy ]). Briefly explain how this follows from the formula. 
If you have any difficulty answering the question about the axis, review the meaning of the fraction  (Subscript[((Subscript[f,  x ])),  y ]) discussed in part (b).

In the answer box below, write a similar expression for (Subscript[(Subscript[f,  yx ])(0,0),  ]). Also state along which line this expression should be evaluated.

Finally, complete this part by filling in the highlighted spaces in the answer box below:

Bonus 2

(worth 25%; 
  very little, if any, partial credit will be given)

________________________________________________________________

Before you do the assignment, study the following 

Example
	
The Calculus I concept of a limit (i.e. the limit along a given direction) which was presented in the Example before Exercise 2 was trivial: the elevation was constant along any one given direction, and the limit of a constant is just that constant itself. Sooo boooring... Here, you will need to figure out a limit along a curve in a more complicated situation, which we will now illustrate. 
	
	You may recall that by definition of a limit from Calculus I, what is important is the behavior in the process of approaching the limit,  rather than the value of the function (i.e., a graph in 2D) at the origin. We will now apply this definition to determine if the graphs in the next three examples are continuous (the limit equals the value of the graph at a point) or discontinuous (the limit does not equal the value at a point). 
First, execute the following command:

ee1=Plot[1-Exp[-(10*x)^2],{x,-0.5,0.5},PlotRange->All,AxesLabel->{"X","Z"}];
ee2 = Graphics[{PointSize[0.04],Red,Point[{0,0}]}];
Show[ee1,ee2]

Away from the origin, x=0, the graph practically equals one. However, as you move in very close to the origin (but still not to the origin itself !), the graph reaches the value zero along a somewhat steep slope. Thus, this graph is continuous: Its limit as you approach x=0  equals its value at  x=0 . Here and below we will mark this value at  x=0  (but not the limit !! -- see below) by a red dot.  

Second, let us make the slopes in the above example steeper:

ee3=Plot[1-Exp[-(100*x)^2],{x,-0.5,0.5},PlotRange->All,AxesLabel->{"X","Z"}];
Show[ee3,ee2]

This graph still looks continuous, although now one needs to move much closer towards the origin to approach the graph’s limiting value. (Note: One can, of course, reduce the range for  x  so as to see the “dip” much clearer. However, the game here is not to change the plotting range but to look at the same range and decide whether a given graph looks continuous.) 

Third, and last, let us go for the kill:

ee4=Plot[1-Exp[-(1000*x)^2],{x,-0.5,0.5},PlotRange->All,AxesLabel->{"X","Z"}];
Show[ee4,ee2]

As far as one can see from this plot (again, without changing its range), no matter how close one moves towards the origin, one sees that the graph’s value near the origin (i.e. as one approaches the limit) does not equal the value at the origin (the dot). Namely, the first value (the limit) = 1,  while the value at the origin = 0. Thus, from this plot, the graph appears to be discontinuous.

You will need to keep this illustration of a continuous-versus-discontinuous behavior in mind when analyzing the (dis)continuity of the Exercise below from the viewpoint of the Calculus I concept (stated earlier). 


You should now be ready to do this Exercise.
___________________________________________________________

Clear[x,y];

In an example in class it was shown that the function

			f(x,y) = (((x^2)y)/((x^4)+(y^2)))
			
is discontinuous at the origin. In this Exercise you will investigate how easily that discontinuity can be detected with a 3D plot (part (a)) and with a contour plot (part (b)).

(a)  In the notes for Sec. 14.2, find the answers to the following questions:
(i)   What is the limit of  f(x,y)  at (0,0)  along the lines  y = k x ?
(ii)  Along which curve does the limit equal  0.5 ?

Now make a 3D plot of this function. Use [-1,1] as the range for both x and y. Set the number of PlotPoints to 50 (as before). Label the x- and y-axes.

The surface in your plot will likely have tiny spikes near the origin. Ignore them: they are an artifact, which occurs because Mathematica can use only finitely many points when plotting a function. So, when you see such spikes on top of an otherwise smooth ridge, assume that the ridge is actually smooth.

From this plot, does the function appear to have a limit at  (x=0, y=0)?  
In answering this question, make sure to use both concepts -- from Calculus I and III -- described in the Example above and the Example before Exercise 2. 

If there appears to be no limit, explain why you think so (again, based on the 3D plot!). In particular, you should specify (at least) two directions along which the limits at  (x=0, y=0)  are different, and state what these different limits are (approximately). 
If, on the other hand, you believe that the plot suggests that the function has a limit, then state:
  * what this limit is,  and 
  * whether it is approached in the same manner (e.g., faster or slower) from all directions, or differently from different (what?) directions. (If the same value is approached, say, faster along the  x-axis than along the  y-axis, the limit will still exist.)
  
Once again:  make sure that your answer agrees with your plot, not with the answer from your notes. I will accept an answer as correct as long as your explanation is coherent and agrees with your plot. However, I will give no credit for an answer that merely coincides with the answer in the notes but is lacking a thoughtful explanation. 

Last suggestion: Make sure that what you say is clear to yourself in the first place. Think simple, don’t try to impress the instructor (and confuse yourself) with mathematical jargon. Imagine you are a tourist who treads the terrain depicted in the plot and eventually reaches the point  (x=0, y=0). Will the elevation at your destination point depend on which direction you are have come from? If ‘yes’, then how? If ‘no’, you still may (if you wish) comment on whether there are specific directions along which it would be easier (or harder) to reach the destination point. Pretend that when treading this imaginary terrain, your boots have very good traction and you can go up or down very steep, but not infinitely steep, slopes (i.e., you are not allowed to jump straight up or down).

Now, make two new variations of the plot you have just made, where you will keep everything the same except for the ranges for x and y. 
Namely, in the first new plot, make the range for both x and y  to be [-0.1,0.1]. 
In the second new plot, keep that range for x but make the one for y to be [-0.01,0.01]. 

That is, you are trying to zero in on the vicinity of the origin to figure out whether this affects the behavior of the 3D plot.

Has zeroing in on the origin affected the value   (lim_((x,y)->(0,0)))f(x,y)  as it is seen in these new plots? If ‘no’, just say so. If ‘yes’, briefly explain what qualitative changes to the plot you see as you zero in.

(b)   Now make a contour plot of this function, taking both  x  and  y  to be between  -0.1 and  0.1. Set the number of PlotPoints to 50. Give a name to this plot; you will need it soon.

Experiment with the above plot by taking different ranges for  y  while keeping the range for  x  to be [-0.1,0.1], i.e. the same as above. As a result of your experimentation, you should find such a range for  y  that makes it very clear that the function attains different limits as the origin is approached along different curves. [Hint:  Your answer to Question (ii) in part (a) should help you guess that range quickly.] 
When examining the limiting behavior near the origin, follow the methodology of the examination of the contour plot in the Example before Exercise 2. Also, you may want to hover the cursor around the origin and interpret the changing numbers as was explained in Comment (i) of the Introduction. 
 

Please do not keep multiple plots from your experimentation; just keep the one which you think shows the behavior near the origin the best. Reassign to it the same name that you gave to the first plot in this part.

Finally, plot (in color) the curve mentioned in Question (ii) of part (a). Then plot it together with the named contour plot obtained above (i.e., in part (b)). (When plotting them together using  Show[...], list the contour plot first and the 2D plot of the curve second; otherwise the latter will not be visible in the combined plot.)

Which type of plot, a 3D plot or a contour plot, worked better to detect the surface discontinuity in this Exercise? (Give an answer based on your results, not on what you think I expect you to say.) Please explain your answer. Your explanation must follow the lines of analysis of a discontinuity:
a) in a 3D plot  and 
b) in a Contour plot, 
as found in the Examples before this Exercise and Exercise 2. 
I will accept your answer and explanation as “correct” if they logically follow from the plots and preceding answers in this Exercise. However, I will not give any credit if they contradict any of the above.