Math 105: Level Sets and Contour Plots

Lecture 5: Feb 15,2010

f[x_,y_] := (x^2+y^2)^2 -4(x^2+y^2)

Manipulate[Plot3D[f[x,y], {x,-a,a},{y,-a,a}],{a,.1,4}]

Manipulate[ContourPlot[f[x,y], {x,-a,a},{y,-a,a}],{a,.1,4}]

Manipulate[ContourPlot[f[x,y] == c, {x,-3,3},{y,-3,3}],{c,-4,4}]

Manipulate[Plot3D[{f[x,y],c}, {x,-a,a},{y,-a,a}],{a,.1,4},{c,-4,4}]

Note our function can be written compactly in polar coordinates
It is r^4 - 4 r^2 or r^2 (r^2 - 4) or r^2 (r-2) (r+2).

Thus our function is negative for r up to 2 and positive from there onward. If we are looking for level curves, we are solving the quartic r^4 - 4 r^2 = c. If we let u = r^2, this is the same as solving u^2 - 4u - c = 0.

The solutions are u = (4 +- Sqrt[16-4c])/2 = 2 +- Sqrt[4-c].

Thus the solutions are r = Sqrt[2 +- Sqrt[4-c]], subject of course to r ≥ 0.

In other words, the level set of value c is either zero, one or two circles (if c = 0 the circle is a point).