# How can PowerExpand be made to evaluate the ArcTan form that takes two arguments?

Consider

c = Cos[phi];
s = Sin[phi];
ArcTan[c, s] // PowerExpand
ArcTan[s/c] // PowerExpand


which yields

ArcTan[Cos[phi], Sin[phi]]
phi


Oddly, PowerExpand does not find its way with the two argument version of ArcTan. However, it does with the single argument ArcTan, as expected.

I like to use ArcTan with two arguments since it does not suffer from division by zero unless numerator and denominator are zero.

How can I tell PowerExpand to find its way into all inverse triginometric functions (assuming positive real variables, etc)?

What side effect would I suffer, if I attach a rule to PowerExpand or better yet to inverse trigonometric functions to deal with ArcTan[c, s] as ArcTan[s/c]? What other identities around trigonometric and inverse trigonometric functions and the exponential function that would also fit such considerations?

• You might consider using the identity $$\arctan(x,y)=2\arctan\left(\frac{y}{x+\sqrt{x^2+y^2}}\right)$$ as a replacement rule... – J. M. is away Mar 3 '16 at 11:22
• I think the two argument form is intended to be used as computational convenience and not as a mathematical function. – m_goldberg Mar 3 '16 at 11:31
• @m_goldberg the 2-argument form of ArcTan is the only way to recover the angle in the correct quadrant, so it is a distinct function from the 1-argument form. – Jason B. Mar 3 '16 at 11:33
• @adalbert-hanßen, I don't foresee any negative consequences of doing Unprotect[PowerExpand]; PowerExpand[ArcTan[a_, b_]] := PowerExpand[ArcTan[b/a]]; Protect[PowerExpand]; It gives the return that you are looking for – Jason B. Mar 3 '16 at 11:35
• @JasonB. I am well aware of that. But I don't see how your comment either illuminates or invalidates my comment. My point, to clarify it, is that I don't think the two argument form is meant for symbolic work where PowerExpand is relevant. – m_goldberg Mar 3 '16 at 11:51