Ask Your Question
1

A limit trivial in polar coordinates cannot be computed in Cartesian coordinates. Why ?

asked 2024-10-09 18:06:59 +0100

Emmanuel Charpentier gravatar image

updated 2024-10-25 21:29:46 +0100

FrédéricC gravatar image

Consider :

sage: var("x, y, rho, theta, k")
(x, y, rho, theta, k)
sage: g(rho, theta)=cos(theta)*exp(-rho^2)

sage: parametric_plot3d([rho*cos(theta), rho*sin(theta), g(rho, theta)], (rho, 0, 2), (theta, -pi, pi), aspect_ratio=[1, 1, 2], title="g").show(viewer="tachyon")
Launched png viewer for Graphics3d Object

image description

This function isn't even defined at the origin, nor it does have a limit stricto sensu. It has, however, a well defined directional limit, trivially computed :

sage: limit(g(rho, theta), rho=0)
cos(theta)

In Cartesian coordinates, the function can be expressed as :

sage: f(x, y)=g(rho, theta).subs({rho^2:x^2+y^2, theta:atan2(y, x)}) ; f
(x, y) |--> x*e^(-x^2 - y^2)/sqrt(x^2 + y^2)

We can visually check that this function is the same as $ g $ :

sage: plot3d(f(x, y), (x, -2, 2), (y, -2, 2), aspect_ratio=[1, 1, 2], title="f").show(viewer="tachyon")
Launched png viewer for Graphics3d Object

image description

However, the very same directional limit is irretrievable when expressed in Cartesian coordinates. Using $ k=\tan\theta $ :

sage: f(x, y).subs({y:k*x}).limit(x=0)
ind

There are (at least) two ways to get a result :

sage: f(x, y).subs({y:k*x}).limit(x=0, taylor=True)
1/sqrt(k^2 + 1)
sage: f(x, y).subs({y:k*x}).limit(x=0, algorithm="sympy")
1/sqrt(k^2 + 1)

which is erroneous :

sage: f(x, y).subs({y:x*tan(theta)}).limit(x=0, algorithm="sympy")
sqrt(cos(theta)^2)

In fact, we expect $\cos\theta$ but we get $|\cos\theta|$. In other words, while the function is correctly computed, its directional limit loses its sign.

What am I doing wrong ?

BTW, I have checked that Mathematica stumbles on the same block...

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2024-10-24 06:14:48 +0100

achrzesz gravatar image

Let us start from showing the images of lines y=kx using the section of the graph with the Oxz plane

var('x y z theta rho')
T = Cylindrical('height', ['radius', 'azimuth'])
T.transform(radius=rho, azimuth=theta, height=z)
p=plot3d(cos(theta)*exp(-rho^2),(rho, 0, 2), (theta, 0, pi), transformation=T,
         mesh=true,plot_points=[15,30],thickness=0.6,opacity=0,aspect_ratio=[1,1,1.8])
p1=parametric_plot3d([0,0,z],(z,-1.2,1.2),color='blue',thickness=2,frame=False)
p2=parametric_plot3d([x,0,0],(x,-2.3,2.3),color='blue',thickness=2,frame=False)
po2 = {'fontsize': 20, 'color': 'black'}
t1 = text3d("z", (0,0,1.3),**po2)
t2 = text3d("x", (2.4,0,0),**po2)
(p+p1+p2+t1+t2).rotateZ(-pi/1.55)

image description

The 3d-graphics, the symmetry property: f(-x,y)=-f(x,y) and the calculations:

var("x, y, rho, theta, k");
f(x,y)=x*exp(-x^2-y^2)/sqrt(x^2+y^2)
h(x)=f(x, y).subs({y:k*x})
l=h(x).limit(x=0, dir='-')
r=h(x).limit(x=0, dir='+')
(r,l)

(1/sqrt(k^2 + 1), -1/sqrt(k^2 + 1))

h(x).limit(x=0)

und

show that sage is right - the two-sided directional limits are undefined (for finite k)

Let us check the one-sided limits with k=tan(theta)

f(x, y).subs({y:x*tan(theta)}).limit(x=0,dir='+')

1/sqrt(tan(theta)^2 + 1)

If -pi/2 < theta < pi/2, r>0; we have

1/(tan(theta)^2+1) = cos(theta)^2 and cos(theta)>0,

so for k=tan(theta): 1/sqrt(k^2+1)=cos(theta)

For pi/2 < theta < 3pi/2 where cos(theta)<0 we have

f(x, y).subs({y:x*tan(theta)}).limit(x=0,dir='-')

-1/sqrt(tan(theta)^2 + 1)

so as before

-1/sqrt(k^2+1)=-sqrt(cos(theta)^2)=-(-cos(theta))=cos(theta)

For theta=pi/2 or 3pi/2 we have x=0 so f(x,y)=0 and the corresponding limit is 0=cos(theta).

In this case the limit is two-sided.

edit flag offensive delete link more

Comments

The source of the problem is :

-1/sqrt(k^2+1)=-sqrt(cos(theta)^2)=-(-cos(theta))=cos(theta)

being taken as the sole solution in $\theta$ of the equality/equation $\displaystyle{1+\tan^2\theta=\frac{1}{\cos^2\theta}}$, which admits two solutions ; this forgets that $\tan$ has period $\pi$ whereas $\cos$ has period $2\pi$. Sage (and Mathematica, BTW) are a bit pig-headed here...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2024-10-26 14:03:58 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-10-09 18:06:59 +0100

Seen: 206 times

Last updated: Oct 25