> # LIMITS of FUNCTIONS
#
# We will want to use plot3d.

> with(plots):
#
# FIRST FUNCTION:
#
# This function does not have a limit at the origin. The limit of f(x,y)
# as we move towards
# the origin depends on the direction we use.
#

> f:=x*y/(x^2+y^2);

[Maple Math]

> plot3d(f,x=-2..2,y=-2..2);

> # The function has a ridge along the line x=y. Every point on this line
# has value 0.5, except
# for the origin. If we look at the contourplot, we see that the
# contours are very close to one
# another near the origin.

> contourplot(f,x=-2..2,y=-2..2);

> #
# SECOND FUNCTION:
#
# This function has the limit of zero as we approach the origin from
# any direction.
# However, the function has a different limit if we look at the parabola
# y=x^2.
# Again, the contours are tightly bunched near the origin.

> g:=x^2*y/(x^4+y^2);

[Maple Math]

> plot3d(g,x=-2..2,y=-2..2);

> contourplot(g,x=-2..2,y=-2..2);

> #
# THIRD FUNCTION:
#
# This function does have a limit as (x,y) tends to (0,0).
# Notice that the contours don't show the same bunching as in the
# previous two examples.

> h:=2*x^2*y/(x^2+y^2);

[Maple Math]

> plot3d(h,x=-2..2,y=-2..2);

> contourplot(h,x=-2..2,y=-2..2);

> #
# Now look at a COMPOSITION of two continuous functions.
# x^2+y^2 is continuous everywhere. tan(r) is continuous if Pi/2 < r <
# 3Pi/2

> p:=tan(sqrt(x1^2+y1^2));

[Maple Math]

> # We need to use polar coordinates to plot this, because we want to
# control the value of x^2+y^2

> x1:=r*cos(t); y1:=r*sin(t);

[Maple Math]

[Maple Math]

> plot3d([x1,y1,p],r=Pi/2+0.1..3*Pi/2-0.1,t=0..2*Pi);

>