This is because Mathematica doesn't have definitions for the derivative of Abs
and Arg
, so it can't do series expansions of expressions containing them. Consequently, it doesn't evaluate the Residue
of such expressions either. But you could define a new function residue
that knows how to extract the harmless logarithm before going on:
Clear[arg, log];
arg[z_, σ_: - Pi] :=
Arg[z Exp[-I (σ + Pi)]] + σ + Pi;
log[z_, σ_: - Pi] := Log[Abs[z]] + I arg[z, σ]
ClearAll[residue];
SetAttributes[residue, HoldAll]
residue[x_, var_] :=
Residue[Unevaluated[x] /. a_log :> Limit[a, Rule @@ var], var]
Here are two examples, first the conventional branch cut, then your example:
residue[2 log[2 z + 2]/z, {z, 0}]
(* ==> 2 Log[2] *)
residue[Exp[(1/3) log[z, 0]]/(z^2 + 1), {z, I}]
(* ==> -(1/2) (-1)^(2/3) *)
I didn't put in any checks for existence of the Limit
that I take in residue
. I assume you'll choose the expansion point such that it doesn't conflict with the branch choice.
Explanation
The purpose of residue
is to implement the relation $\text{res}_{z0}\left(f(z)\,g(z)\right)= \text{res}_{z0}\left(g(z0)\,f(z)\right)$ if $g(z)$ has no singularity at $z0$. In particular, it assumes that we have chosen the branch cut such that any term involving log
(as defined above) can be treated as if it were such a $g(z)$. Really, what this does is to turn $g$ into a constant factor that could be pulled out.
To be able to pull out such terms from under the original residue
, I give this new function the HoldAll
attribute (HoldFirst
would also work here). This is necessary so that the previously given definition for log
is not used until after I'm done extracting it from the residue (otherwise we would at that point end up with Abs
and Arg
inside Residue
, which halts the evaluation).
The extraction of log
happens with a replacement rule, where I look for any object with Head
equal to log
inside the Unevaluated
form of the input expression. By matching only the Head
without looking into the arguments of log
, I prevent the evaluator from kicking in (it would do that because Unevaluated
is a "temporary" construct, not like Hold
; but it's sufficient here).
Having identified the log
with a dummy name a
, I then evaluate it and replace any occurrence of the variable that was specified in var
by its value at the expansion point. The argument var
is of the form {z, z0}
, so it's easy to do this replacement by writing it as a Limit
for z -> z0
. This is what Rule @@ var
is for. At that stage, the evaluation of the enclosing Residue
can proceed, with log
having been turned into a constant. You could do similar replacements not just for log
but also for other functions that prevent Residue
from working, if you know they have no poles.