Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to solve $dx/dt=\sqrt{1 + (I x)^3}$, where x is complex, for some initial condition like $1 - 5 I$ and plot the imaginary part of the solution versus the real part. (A somewhat similar problem was posted earlier in different topic)

I have used this code:

s = NDSolve[{x'[t] == (1 +(I x[t])^3)^0.5, x[0] == 1 -5 I}, x[t], {t, 0, 10}];
ParametricPlot[Evaluate[{Re[x[t]], Im[x[t]]} /. s1], {t,0,10}]

and I have tried it for different initial points, the results are not satisfactory. I expect to obtain closed contours for every initial condition in the lower half plane of complex plane, excatly like this: enter image description here

(As a side and not very important remark x plus, minus and zero are where the square root vanishes)

I appreciate if one could help me to fix it!


Can this problem be due to branch points?

share|improve this question
Not using any boundary-condition I got with DSolve[{x'[t] == (1 + (I x[t])^3)^0.5}, x[t], t] a rather sophisticated solution involving the inverse of Hypergeometric2F1. At this point I got stuck. – eldo Jun 5 '14 at 17:59

The closed contours are indeed difficult to produce in a ParametricPlot because the parametrization in terms of t doesn't allow you to follow a single closed curve beyond the singularity of Sqrt[1 + (I x)^3]. So it's fair to say that your issues are caused by the branch cuts. One can also see this by letting Mathematica do more of the work automatically, using StreamPlot. Streamlines in the xy plane are basically the equivalent of the contours in the complex plane that you're after.

With[{xMin = 3},
  {Re[#], Im[#]} &[Sqrt[1 + (I (x + I y))^3]],
  {x, -xMin, xMin}, {y, -xMin, xMin}, 
  StreamPoints -> {{{0, 0}, Automatic, 6}}]

one streamline

This was created from a single StreamPoint as a starting condition for a stream line. You can see that we jump to different curves whenever a singularity of the derivative is crossed.

However, StreamPlot does produce something close to what you need if we let it choose the StreamPoints starting conditions automatically:

With[{xMin = 3},
  {Re[#], Im[#]} &[Sqrt[1 + (I (x + I y))^3]],
  {x, -xMin, xMin}, {y, -xMin, xMin}]

full plot

share|improve this answer
I have the impression that StreamPlot is the better NDSove. I am impressed. – eldo Jun 5 '14 at 21:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.