# Plotting complex functions to find solutions

Is ParametricPlot3D the best way to plot complex functions to find solutions?

The algebra for $e^z = 2 i$ tells me that there are infinite solutions at $\frac{\pi}{2} + 2 n \pi$ for all $n \in \mathbb{N}$.

So I do this

three = ParametricPlot3D[{z, Re[E^z], Im[E^z]}, {z, -5, 5}, PlotStyle -> {{Red}}];
four = ParametricPlot3D[{z, Re[2 I], Im[2 I]}, {z, -5, 5}, PlotStyle -> {{Blue}}];
Show[three, four]


and get

What happened to the $2i$? I'm expecting to see two lines that periodically intersect.

Should I not be using ParametricPlot3D at all?

• Show[three, four, PlotRange -> All, BoxRatios -> {1, 1, 1}] Nov 14 '15 at 15:00
• Your algebra is wrong - you're plotting for real z when the solutions are imaginary: Log[2] I (Pi / 2 + 2 Pi n) Nov 14 '15 at 15:06

I tend to use ContourPlot[] instead.

ContourPlot[With[{z = x + I y}, {Re[Exp[z] - 2 I], Im[Exp[z] - 2 I]}] // Evaluate,
{x, 0, π}, {y, -3 π, 3 π}, AspectRatio -> Automatic,
Contours -> {0}, ContourShading -> False]


(See this related thread as well.)

Just to show analytic and plot solutions:

Reduce[{Exp[x] Sin[y] == 2, Cos[y] == 0}, {x, y}, Reals]
lp = ListPlot[tb = Table[{Log[2], Pi/2 + 2 Pi j}, {j, -2, 2, 1}],
PlotMarkers -> {Automatic, 10}, PlotStyle -> Red];
cplot = ContourPlot[
Through[{Re, Im@# - 2 &}[Exp[x + I y]]], {x, 0, Pi}, {y, -3 Pi,
3 Pi}, Contours -> {0}, ContourShading -> None,
GridLines -> {{Log[2]}, None},
FrameTicks -> {Range[0, Pi, Pi/2], Range[-7 Pi/2, 7 Pi/2, Pi/2]}];
Show[cplot, lp]