# Solving complex equation numerically

I'm trying to solve the following equation for $$z$$ for a set of given complex values of $$a$$ and for fixed $$b$$ (without providing any initial guess value(s)):

$$2^{iz}~\Gamma\left(\dfrac{iz+b}{2}+1\right)\Gamma\left(\dfrac{iz-b+1}{2}\right) = a$$

I've already tried with Solve, NSolve and NSolveValues, but no result is being produced!

b = 5;
a = 1.2 + 2.0I;
Solve[2^(I z) Gamma[(I z+b)/2+1] Gamma[(I z-b+1)/2] == a, z]
NSolve[2^(I z) Gamma[(I z+b)/2+1] Gamma[(I z-b+1)/2] == a, z]
NSolveValues[2^(I z) Gamma[(I z+b)/2+1] Gamma[(I z-b+1)/2] == a, z]


Output: Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Solve require exact input, providing Solve with an exact version of the system may help.

And the other two methods aren't producing any results!

Same problem is there even if I split this expression using natural logarithm:

$$iz\ln{2} + \ln\left[\Gamma \left(\dfrac{iz+b}{2}+1\right)\right] + \ln\left[\Gamma \left(\dfrac{iz-b+1}{2}\right)\right] = \ln{a}$$

So now how to solve?

Another way is

b = 5;a = 1.2 + 2.0I;NSolve[2^(I z) Gamma[(I z + b)/2 + 1] Gamma[(I z - b + 1)/2] == a &&
Re[z] >= -5 && Re[z] <= 5 && Im[z] >= -5 &&  Im[z] <= 5, z, Complexes]


{{z->-4.90799-3.04034 I},{z->-2.66851-1.46792 I},{z->-0.662739+0.308154 I},{z->1.26622 -0.268927 I},{z->3.38646 -2.01853 I}}

• Solve[2^(I z) Gamma[(I z + b)/2 + 1] Gamma[(I z - b + 1)/2] == a && Re[z] >= -5 && Re[z] <= 5 && Im[z] >= -5 && Im[z] <= 5, z, Complexes] produces the same result. Commented Apr 6, 2023 at 18:15

When the other methods fail you will need to use FindRoot and provide initial estimates.

b = 5;
a = 1.2 + 2.0 I // Rationalize;

f[z_] = 2^(I z) Gamma[(I z + b)/2 + 1] Gamma[(I z - b + 1)/2] - a;

sol = (FindRoot[f[z] == 0, {z, #},
WorkingPrecision -> 15] // N) & /@
{1 + I, 1 - I, -1 + I, -1 - I} // Union

(* {{z -> -0.662739 + 0.308154 I}, {z -> 0.0374761 + 2.02576 I}, {z ->
1.26622 - 0.268927 I}} *)

2^(I z) Gamma[(I z + b)/2 + 1] Gamma[(I z - b + 1)/2] == a /. sol

(* {True, True, True} *)