# Cannot get rid of Arg with FullSimplify

This expression keeps showing up in a much larger expression, making it seem more complicated than it is, because this expression is necessarily just 0:

$Assumptions = a ∈ Reals; ComplexExpand[Arg[a + I a] + Arg[a - I a]] // FullSimplify  Arg[(1 - I)a] + Arg[(1 + I)a] I know it won't compute Arg when its argument is not numeric, but shouldn't there be a way to recognize when two Arg expressions are equal and opposite?? --Edit-- As BlacKow pointed out, Arg works with the a > 0 assumption for the expression above. However, I run into a problem as soon as the expression gets more complicated, i.e.: $Assumptions = {a \[Element] Reals,a>0};
ComplexExpand[ Arg[a + I a^2] + Arg[a - I a^2]]//FullSimplify


Arg[1-Ia]+Arg[1+Ia]

• $Assumptions = {a > 0} fixes it – BlacKow Dec 6 '16 at 23:44 • Thank you, that does work for the expression in my question. However, it weirdly does not work when I try it on an even slightly more complicated one:$Assumptions = {a [Element] Reals,a>0}; ComplexExpand[ Arg[a + I a^2] + Arg[a - I a^2]]//FullSimplify Arg[1-[ImaginaryI] a]+Arg[1+[ImaginaryI] a] sorry, I don't know how to format the comments – partyphysics Dec 6 '16 at 23:59

You could define a transformation function for Simplify to use.

xform[Arg[(1 + I) a_]] := a π/4
xform[Arg[(1 - I) a_]] := -a π/4


then

Simplify[Arg[a + I a] + Arg[a - I a], TransformationFunctions -> {xform}]


0

• Thanks, I might be able to do something with TransformationFunctions. The full expression in all its ugliness is "Arg[2 -a^2 + I a Sqrt[4 - a^2]] + Arg[2 - a (a + I Sqrt[4 - a^2])]" so I would have to adapt it a little, but it could work – partyphysics Dec 7 '16 at 0:12
• @partyphysics. I can only work with the information that you give in your question. – m_goldberg Dec 7 '16 at 0:20
• I know, I was just hoping there was a general solution. I may encounter the same problem with a different expression soon – partyphysics Dec 7 '16 at 0:24

It seems that the case $a=0$ is part of the issue, even though Arg[0]is defined to be 0. For some reason all of these work:

Assuming[a > 0, Arg[a + I a] + Arg[a - I a] // Simplify]
Assuming[a > 0, ComplexExpand[Arg[a + I a] + Arg[a - I a]] // Simplify]
Assuming[a < 0, ComplexExpand[Arg[a + I a] + Arg[a - I a]] // Simplify]
(*
0
0
*)


However this does not:

Assuming[a \[Element] Reals && a != 0,
ComplexExpand[Arg[a + I a] + Arg[a - I a]] // Simplify]
(*
Arg[(1 - I) a] + Arg[(1 + I) a]
*)

• Very strange, I do not understand this – partyphysics Dec 7 '16 at 0:21

ReplaceRepeated seems to solve it. I couldn't get Replace or Simplify with Transformation Functions to work, because sometimes the Arg terms would have additional Arg terms within them after operating on them with ComplexExpand. This is the code that works with a sample expression (the one that was bugging me):

someuglyexpression =E^(I*(Arg[2 + h (-h + Sqrt[-4 + h^2])] +Arg[2 - h (h + Sqrt[-4 + h^2])]))
ReplaceArgWithArcTan={Arg[z_]->ArcTan[Im[ComplexExpand[z]]/Re[ComplexExpand[z]]]} ;
lessuglyexpression = someuglyexpression //.ReplaceArgWithArcTan //FullSimplify


before:

after: 1