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??


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


  • $\begingroup$ $Assumptions = {a > 0} fixes it $\endgroup$ – BlacKow Dec 6 '16 at 23:44
  • $\begingroup$ 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 $\endgroup$ – 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


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


  • $\begingroup$ 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 $\endgroup$ – partyphysics Dec 7 '16 at 0:12
  • $\begingroup$ @partyphysics. I can only work with the information that you give in your question. $\endgroup$ – m_goldberg Dec 7 '16 at 0:20
  • $\begingroup$ I know, I was just hoping there was a general solution. I may encounter the same problem with a different expression soon $\endgroup$ – 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]

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]
  • $\begingroup$ Very strange, I do not understand this $\endgroup$ – 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

ugly expression

after: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.