Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I need help with solving this differential equation.

  {D[x[r], {r, 2}] + (1/r) D[x[r], r] + (1 - 1/r^2) x[r] - x[r]^3 == 0, 
   x[0] == 0, x[Infinity] == 1}, x[r], r]

I tried to solve this with DSolve, but no success. Any suggestion is highly appreciated.

share|improve this question
A side remark: I see your efforts in making nice typeset of the question. However, it would be better if the code is typed in "Code Sample" block, which is the "{}" sign on the edit bar. Then people can copy and paste your code when they want to try it. –  Yi Wang Feb 10 '14 at 10:09
You won't be able find closed for solution for this. First, it is non-linear. Second, there is removable singularity at $x=0$, and third is is a boundary value problem. You can try a Frobenius series solution and see if this works. Or just try a numerical solution. Even that requires some work to get right. Screen shot !Mathematica graphics –  Nasser Feb 10 '14 at 10:24

1 Answer 1

You are trying to exactly solve the Ginzburg-Landau equation with potential 1-\frac{1}{r^2}. No wonder that you fail: it has no analytical solution. At least no solution that I would hear about, and I am in this business already for some time. One reason to see that it has no non-trivial exact solution is that when you fix its boundary conditions in another way: e.g. being zero at both ends it has a trivial solution x === 0 and may have a non-trivial one (at least if you introduce a parameter into it, then it will (or may) show up in some region of the parametric space. In such cases equations only rarely show analytical solutions that embrace both branches. And I guess this will not. Further, you may want to go through the book of Kamke, where all known to him cases were collected. But that is only to check that it is not there, I checked some years ago.

I advise you to try to solve it numerically:


Xmax = 100;
eqbc = {eq, x[0.01] == 0, x[Xmax] == 1};
sl = NDSolve[eqbc, x, {r, 0.01, Xmax}, 
  Method -> {StiffnessSwitching, 
  Method -> {ExplicitRungeKutta, Automatic}}, 
  AccuracyGoal -> 5, 
  PrecisionGoal -> 4]

returning the interpolation function. Then this:

Plot[Evaluate[x[r] /. sl], {r, 0.01, Xmax}, 
  AxesLabel -> {Style["x", Italic, 16], Style["r", Italic, 16]}, 
  AxesStyle -> Arrowheads[0.05]]

Shows you the result. It should look like the following:

enter image description here

Does it have sense for you? Have fun!

share|improve this answer
I am trying to calculate for Xmax = 10, but I get a few errors related to the singularities. Errors disappear for Xmax = 1. –  artalexan Feb 10 '14 at 11:15
Problems with an account again, or it's not you? :) –  Kuba Feb 10 '14 at 11:44
@artalexan for me it worked also for Xmax=10, no problem. You should use the StiffnessSwitching method, do you? –  Alexei Boulbitch Feb 10 '14 at 12:54
@Kuba Yes, that's me. I did not notice that it opens under a new account. –  Alexei Boulbitch Feb 10 '14 at 12:55
@Alexei Boulbitch I get the same plot, but with a few errors like this. NDSolve::ndsz: At r == 0.9111834202476907`, step size is effectively zero; singularity or stiff system suspected. >>. I am using Mathematica 9 x64. –  artalexan Feb 10 '14 at 14:38

Your Answer


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

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