# How do I keep track of the discontinuous jumps of the argument of a complex function along a contour in the complex plane in Mathematica?

In complex analysis, let's say I choose a branch of the complex logarithm (so that I can calculate the argument of a complex function), and I want to study numerically the variation of the argument of this complex function along a given contour in the complex plane. I am not just interested in the principal argument, I want to keep track of the discontinuous jumps of the argument of the complex function along that given contour, when the function touches the branch cut. How do I do that in Mathematica?

• Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
– Community Bot
Feb 26 at 11:00
• Would be helpful if you precisely define an example $\log(z)$ branch $y(z)$, then an example paramaterization such as $z(t)$ over which you wish to evaluate $y(z(t))$. Also essential you understand clearly the analytic geometry of the $\log(z)$. Maybe this thread would be helpful: mathematica.stackexchange.com/questions/263861/…
– josh
Feb 26 at 15:11

MMA will always give you the main branch. If you want a continuous function, you have to adjust the argument "by hand".

Here is a simple example:

fun[t_] = Exp[I t];
old = 0;
arg = 0;
Manipulate[
arg = Arg[fun[t]];
If[old - arg > Pi, arg += 2 Pi]; If[old - arg < -Pi, arg -= 2 Pi];
old = arg;
old = arg;
Graphics[{
{Green, Circle[]}
, {PointSize[Medium], Red, Point[ReIm[fun[t]]]}
, Text[StringForm["Argument: ", arg], {0, 1.1},
BaseStyle -> Medium]
}, Axes -> True]
, {{t, 0}, -3 Pi, 3 Pi}, TrackedSymbols :> t] • Thank you for the answer @DanielHuber . I assume this is just a fragment of the program. It doesn't include the curve parametrization z(t), for which we calculate arg f(z(t)) for a sequence of close points along the curve, right? Feb 26 at 13:12
• This is only a demo to show how to keep track of a jump in the argument. You can look at it as a parametrized curve that is the circle and the function f would be the identity. Or you can look at it as: curve = straight line from -3Pi to 3Pi along the real axis and the function is Exp[I t] Feb 26 at 13:34

For the example you give, Log, its derivative is uniquely defined. You can therefore specify the value by the integral along a defined path. E.g.

path = Table[Exp[I n], {n, 1, 20}]
(* {E^I, E^(2 I), E^(3 I), E^(4 I), E^(5 I), E^(6 I), E^(
7 I), E^(8 I), E^(9 I), E^(10 I), E^(11 I), E^(12 I), E^(13 I), E^(
14 I), E^(15 I), E^(16 I), E^(17 I), E^(18 I), E^(19 I), E^(20 I)} *)

Integrate[1/x, Prepend[path, x]]
(* 19 I *)


(I don't know why Mathematica is quite so slow in evaluating this integral)