1
$\begingroup$

I'm searching for the roots of a complex function of $x$ with parameters $k$ and $q$ $$ \begin{align*} f(x;q,k)&= 2 i q\log(-2 ik)+i\pi-2 i\;\text{Im}\big(\log(\Gamma(1+2 i q))\big)\\ &+\log\left(\frac{\Gamma(1+i q+i qx/k)}{\Gamma(1+iq+iqx/k)}\right)+\log\left(\frac{\sqrt{1-x}-\sqrt{-1-x}}{\sqrt{1-x}+\sqrt{-x-1}}\right) \end{align*} $$ where $k=\sqrt{(-x+1)(-x-1)}$, $x$ is complex with $\text{Re}(x)<-1$ and $\text{Im}(x)>0$ and $q$ is real and positive parameter. If I change the seed in FindRoot slightly, the result changes dramatically. How may I efficiently find these roots?

Code:

2 I*q*Log[-2*I*Sqrt[(-x + 1) (-x - 1)]] + I*π -  2*I*Arg[
Gamma[1 + 2*I*q]] + Log[Gamma[1 + I*q - I*q*x/Sqrt[(-x + 1) (-x - 1)]]] - 
Log[Gamma[1 - I*q - I*q*x/Sqrt[(-x + 1) (-x - 1)]]] + Log[Sqrt[-x + 1] - 
Sqrt[-x - 1]] - Log[Sqrt[-x + 1] + Sqrt[-x - 1]]
$\endgroup$
8
  • 6
    $\begingroup$ Could you post some code? The function and the FindRoot? $\endgroup$
    – Öskå
    May 31, 2013 at 9:10
  • $\begingroup$ Find the code above $\endgroup$
    – Valeriy
    May 31, 2013 at 19:16
  • $\begingroup$ What's the actual value of q? $\endgroup$ May 31, 2013 at 20:21
  • $\begingroup$ You seem to have a highly oscillatory function near x == -1, for q == 0.1, 1., 10.. Try plotting it (ContourPlot[Abs[fn[x]],...]). $\endgroup$
    – Michael E2
    May 31, 2013 at 20:32
  • 2
    $\begingroup$ You are aware that LogGamma[] is built-in? $\endgroup$ Jun 1, 2013 at 4:09

1 Answer 1

2
$\begingroup$

one of the best way to finding the roots of complex functions is Davidenko's Method of Complex Root Search in this way you can find the exact root of complex functions by changing your equation into a differential equation. Here is a sample of this method you can use this way.

(*Davidenko's Method of Complex Root Search*)
Clear[γ]
Pm = D[P, γ];
Intv = .0045 + .0041 I;
γ = a[t] + I *b[t];
g = Re[P];
h = Im[P];
gb = Re[Pm];
ga = -Im[Pm];
Pg = (gb)^2 + (ga)^2;
tf = 20
sol = NDSolve[{a'[t] == ((-gb*g + ga*h)/Pg), 
   b'[t] == ((-ga*g + gb*h)/Pg), a[0] == Re[Intv], 
   b[0] == Im[Intv]}, {b, a}, {t, 0, tf}]
Print[Plot[Evaluate[{b[t], a[t]} /. sol], {t, 0, tf}]]
a[tf] /. sol
b[tf] /. sol

In this method P is your equation that should be equal to zero and Gamma is the variable of your equation and Intv is the initial value that you want to find the root near.

$\endgroup$
2
  • $\begingroup$ I note that you split the equation into real and imaginary parts and solve separately. Mathematica can solve complex differential equations and thus this aspect of your approach may be unnecessary. I keep the equation complex. Are there advantages in splitting the solution procedure? $\endgroup$
    – Hugh
    Mar 4, 2014 at 10:10
  • 2
    $\begingroup$ Can you give a good reference for this method where I can find its description? $\endgroup$
    – bcp
    Apr 3, 2014 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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