Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm defining branch cut functions, and I'm using $arg(z)$ as a building block. So I just spent an hour at the whiteboard assuming that $arg(z)$ goes from $0$ to $2\pi$, and then I implement the code, and everything goes horribly wrong.

I just realized that the problem is that the the Arg function built into Mathematica goes from $-\pi$ to $\pi$. Is there anyway I can redefine Arg so that my code will work?

share|improve this question
arg[z_] /; Im[z] < 0 := Arg[z] + 2 Pi; arg[z_] /; Im[z] >= 0 := Arg[z] –  Artes Apr 12 '14 at 17:31
Thanks! a great ton! –  David Apr 12 '14 at 17:50
See also the arg I use here. –  Jens Apr 12 '14 at 18:10
See also this answer How to calculate contour integrals with Mathematica? regarding closely related branch cuts. –  Artes Apr 12 '14 at 18:22
RELATED –  Vitaliy Kaurov Apr 12 '14 at 20:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.