Why does the command ComplexExpand[Arg[a]] gives Arg[a] instead of 0? Isn't it that ComplexExpand supposed to assume all unspecified variable to be real, and the argument of real variable is 0?


closed as off-topic by Daniel Lichtblau, MarcoB, user9660, RunnyKine, march Mar 25 '16 at 17:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, MarcoB, Community, RunnyKine, march
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ In[1328]:= Arg[-1] Out[1328]= \[Pi] $\endgroup$ – Daniel Lichtblau Mar 25 '16 at 15:23

The function ComplexExpand itself does not know what is a, complex, real and so on. One needs to instruct Mma about it. For example,

    Simplify[ComplexExpand[Arg[a]], a > 0]

(*  0  *)

Here is another example:

    Simplify[ComplexExpand[Arg[a]], a < 0]

(*  \[Pi]  *)

On the other hand, if one does not fix the sign of a, but only that it is Real, Mma assumes that it can have the both signs and leaves the both possibilities:

Simplify[ComplexExpand[Arg[a]], a \[Element] Reals]

(*  Arg[a]  *)

Even more this is valid, if a may be complex:


(*  Arg[a] *)

Have fun!

  • $\begingroup$ ComplexExpand[Arg[a], TargetFunctions -> {Re, Im}] $\endgroup$ – J. M. will be back soon Mar 25 '16 at 10:01
  • 2
    $\begingroup$ Actually ComplexExpand (per documentation) assumes all variables are real valued unless they appear in the optional second argument. What it does not know is whether they are positive or negative. $\endgroup$ – Daniel Lichtblau Mar 25 '16 at 15:23

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