This is a continuation of a question I posed at: Examining the function $f(x,y)=xy(x^2-y^2)/(x^2+y^2)$.
The quest is to analyze the partial derivative $$ f_x(x,y)=\begin{cases} \dfrac{y(x^4+4x^2y^2-y^4)}{(x^2+y^2)^2},&(x,y)\ne(0,0)\\ 0,& (x,y)=(0,0) \end{cases}$$ to see if it is continuous at (0,0). I've tried a little manipulate activity:
DynamicModule[{f, max, min},
fx[x_, y_] :=
Piecewise[{{(y (x^4 + 4 x^2 y^2 - y^4))/(x^2 + y^2)^2,
x != 0 && y != 0}}, 0];
Manipulate[
max = NMaximize[{fx[x, y], Sqrt[x^2 + y^2] < \[Delta]}, {x, y}][[1]];
min = NMinimize[{fx[x, y], Sqrt[x^2 + y^2] < \[Delta]}, {x, y}][[1]];
Column[{
Row[{"Min = " <> ToString[min], ", Max = " <> ToString[max]}],
Plot3D[{fx[x, y],
0}, {x, -\[Delta], \[Delta]}, {y, -\[Delta], \[Delta]},
PlotStyle -> {Directive[Red],
Directive[LightBlue, Opacity[.8]]},
RegionFunction -> Function[{x, y, z}, Sqrt[x^2 + y^2] < \[Delta]],
PlotRange -> All,
BoxRatios -> Automatic,
PerformanceGoal -> "Quality"]
}],
{{\[Epsilon], .1}, .001, .15, Appearance -> "Labeled"},
{{\[Delta], .5}, .01, 1, Appearance -> "Labeled"}
]
]
There are a couple of problems. First, it's very slow as I am calculating min, max, and redrawing the image each time the slide moves. Second, when the delta slider gets tiny, things go bad.
Any thoughts?
Example of something that happens:
NMinimize[{fx[x, y], Sqrt[x^2 + y^2] < .1}, {x, y}]
During evaluation of In[54]:= NMinimize::incst: NMinimize was unable to generate any initial points satisfying the inequality constraints {-0.1+Sqrt[x^2+y^2]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution. >>
Out[54]= {-0.1, {x -> -7.45003*10^-9, y -> 0.1}}
fx[x, y] == -(1/2) r (-1 - 2 Cos[2 t] + Cos[4 t]) Sin[t]
and fairly easy to understand. In particular you can separate variables, optimize overt
-- min/max are always att
equalsPi/2
and-Pi/2
. But as I recall from your other questions, you might want to leave it in terms of cartesian coordinates for the sake of your students. But I would teach my students to analyze this particular function in polar coordinates because of the denominator. (I mean they should take one look and say, "Oh, of course, let's use polar.") $\endgroup$