# nonlinear differential equation

For such a equation

$$-y''(x) + x^2\cdot y(x) - |y(x)|^2\cdot y(x) = 0$$

with initial conditions: $y(-500) = 0$ and $y(500) = 0$.

I write in mathematica

ic1 = 0;
xmax = 500;
xmin = -500;
sol = NDSolve[{-y''[x] + x^2*y[x] - Abs[y[x]]^2*y[x] == 0,
y[xmax] == ic1, y[xmin] == ic1}, y[x], {x, xmin, xmax}]
Plot[y[x] /. sol, {x, xmin, xmax}]


• Can you show the output? It produces a straight zero line for me. May 24 '15 at 12:21
• as far as i know, straight zero line is incorrect for this differential equation May 24 '15 at 12:25
• Well, you can see pretty easily that y(x)=0 is a solution to the DE and the boundary conditions. May 24 '15 at 12:30
• ok, let me correct my expression it is mistake to say incorrect, but are you saying it has only trivial solution ? May 24 '15 at 12:37
• Solving for y[x], we can see that there is only one real root. (Solve[-y''[x] + x^2*y[x] - Abs[y[x]]^2*y[x] == 0, y[x]]). Moreover, your conditions suggestion that, there will be only trivial solution to this problem. Please paste a link, where we can see the equation ourselves.
– zhk
May 24 '15 at 15:12

It seems that the ode under discussion has only trivial solution.

I checked it with both Mathematica and maple and got what was expected.

Mathematica output

Plot[y[x] /. sol, {x, xmin, xmax}]


Maple output

restart:with(plots):


ode:=-diff(y(x),x\$2)+x^2*y(x)-abs(y(x))^2*y(x)=0;

ics:=y(-500)=0,y(500)=0;

p:=dsolve({ode,ics},numeric);

odeplot(p);

• Thanks for all reply....@ Dr. Wolfgang Hintze yes i am searching for its eigenvalue problem as an exercise either, as you mentioned, with added the term like E*y(x) where E is eigenvalue, Do you have any idea? May 25 '15 at 9:14