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?
ArcTanis 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 03 '16 at 11:33Unprotect[PowerExpand]; PowerExpand[ArcTan[a_, b_]] := PowerExpand[ArcTan[b/a]]; Protect[PowerExpand];It gives the return that you are looking for – Jason B. Mar 03 '16 at 11:35PowerExpandis relevant. – m_goldberg Mar 03 '16 at 11:51Unprotect[ArcTan]; PowerExpand[ArcTan[a_, b_]] ^:= PowerExpand[ArcTan[b/a]]; Protect[ArcTan];– m_goldberg Mar 03 '16 at 11:59ArcTan[x, y] // TrigToExp;) – J. M.'s missing motivation Mar 03 '16 at 12:15ArcTan[c, s] // TrigToExp // FullSimplifyand then tell me why that doesn't simplify further... Scratch that, I see my mistake – Jason B. Mar 03 '16 at 12:26Exp[]is $2\pi i$-periodic has something to do with it. ;) – J. M.'s missing motivation Mar 03 '16 at 12:32PowerExpandis called, even when the expression being evaluated has nothing to do withArcTan. With^:=is will only considered whenArctanhas been seen as an argument. – m_goldberg Mar 03 '16 at 12:33