I have a problem in Mathematica and I need your help please. As you know, If the complex number z=x+I y is located at the first quarter of the plane, I mean when (x>0 & y>0) then, the argument of thiscomplex number is : Arg[x+I y]= ArcTan[y/x]. In similar way, If (x>0 & y<0) then: Arg[x+I y]=\pi-ArcTan[y/x].
My question is:For instant, How can I enforce MATHEMATICA to replace Arg[x+I y] by ArcTan[y/x] when (x>0& y>0).
In[1]:= (* this is expected *)
Arg[2 + 3 I]
Out[1]= ArcTan[3/2]
In[2]:= (* Mathematica allows for x or y to be complex, so it returns \
unevaluated *)
Arg[x + y I]
Out[2]= Arg[x + I y]
In[3]:= (* but I thought this would return ArcTan[x,y], but it does \
not *)
Refine[Arg[x + y I], {x, y} \[Element] Reals]
Out[3]= Arg[x + I y]
Yes. That is a good point, Gianluca. It perhaps explains the whole issue. Since both x and y could be zero, any symbolic return for Arg, even in Reals, would have to include a conditional.