# ComplexExpand and Arg function [closed]

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, marchMar 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.

• In[1328]:= Arg[-1] Out[1328]= \[Pi] – 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:

Simplify[ComplexExpand[Arg[a]]]

(*  Arg[a] *)


Have fun!

• ComplexExpand[Arg[a], TargetFunctions -> {Re, Im}] – J. M. will be back soon Mar 25 '16 at 10:01
• 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. – Daniel Lichtblau Mar 25 '16 at 15:23