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

which yields

ArcTan[Cos[phi], Sin[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?

  • $\begingroup$ 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... $\endgroup$ – J. M. is computer-less Mar 3 '16 at 11:22
  • $\begingroup$ I think the two argument form is intended to be used as computational convenience and not as a mathematical function. $\endgroup$ – m_goldberg Mar 3 '16 at 11:31
  • 1
    $\begingroup$ @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. $\endgroup$ – Jason B. Mar 3 '16 at 11:33
  • $\begingroup$ @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 $\endgroup$ – Jason B. Mar 3 '16 at 11:35
  • $\begingroup$ @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. $\endgroup$ – m_goldberg Mar 3 '16 at 11:51

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.