TransWikia.com

How to solve a nonlinear second order ODE

Mathematica Asked by ARK69 on August 22, 2020

I want to solve this equation

y''[x] + a + b y[x] + c y[x]^2 == 0, y[∞] == 0, y'[∞] == 0 

where a, b and c are constants.

2 Answers

Not an answer, but long comment and some analysis.

The problem can be more clearly seen as follows.

The solution to the ODE contains elliptic integrals, whose solution contain elliptic special functions.

The problem is evaluating this at $infty$ and its derivative also, to solve for the constant of integrations. And this it can not do.

The solutions to your ode without the BC is actually

$$ int ^{y left( x right) }!-3,{frac {1}{sqrt {-6,c{{it _a}}^{ 3}-9,b{{it _a}}^{2}-18,a{it _a}+9,{it _C1}}}}{d{it _a}}-x-{ it _C2}=0 $$

$$int ^{y left( x right) }!3,{frac {1}{sqrt {-6,c{{ it _a}}^{3}-9,b{{it _a}}^{2}-18,a{it _a}+9,{it _C1}}}}{d{ it _a}}-x-{it _C2}=0 $$

Obtained from Maple.

Mathematica gives the same solution, but it also evaluates these integrals. This is why Mathemtica's solution is (notice the Solve in the solution, which means it is implicit, since it could solve it)

ClearAll[x, y, a, b, c];
ode = y''[x] + a + b*y[x] + c*y[x]^2 == 0
sol = DSolve[ode, y[x], x]

which is

enter image description here

The above is actually the same as solving the integrals from Maple as you can see:

ClearAll[z]
sol = Integrate[-3/Sqrt[-6 c z^3 - 9 b z^2 - 18 a z + 9 C[1]], z]

enter image description here

The problem comes when trying to solve these solution are $y(infty)=0$ and the derivative as well. This is why Mathematica gives the solution as implicit Solve[...]. It can not evaluate these solutions at $infty$ and set the result to zero to solve for the 2 constants of integrations.

May be a smart use of Limit could help. But Maple is also stuck at these B.C. also.

Answered by Nasser on August 22, 2020

DSolveyields an involved implicit result in terms of elliptic integrals. In order to solve explicitly the problem at hand we should first transform the equation. Let's multiply given differential equation by $;y'(x)$ $$y'y''+c y' y^2+by y'+a y'=0$$ then integrating it and multiplying by $2$ we get $${y'}^2+frac{2c}{3}y^3+b y^2+2a y+d=0$$ where $d$ is an integration constant. With appropriate initial or boundary conditions it could be determined. Now, with a bit of insight we would like transforming this differential equation into the Weierstrass canonical form which reads $${y'}^2-4y^3+g_2; y+g_3=0$$ In order to proceed further we change the dependent variable $;y(x)=p; w(x)+q$.

(y'[x]^2 + 2 a y[x] + b y[x]^2 + 2/3 c y[x]^3 + d)/p^2 /. {y'[x] -> p w'[x], 
 y[x] -> p w[x] + q} // Expand // Collect[#, {w[x]}] &
 d/p^2 + (2 a q)/p^2 + (b q^2)/p^2 + (2 c q^3)/(3 p^2)
 + ((2 a)/p + (2 b q)/p + (2 c q^2)/p) w[x] + (b + 2 c q) w[]^2 
 + 2/3 c p w[x]^3 + w'[x]^2

We find $(p,q)$

{p, q} /. First@Solve[{2/3 c p == -4, b + 2 c q == 0}, {p, q}]
 {-(6/c), -(b/(2 c))}

Now we rewrite the differential equation in terms of the new variable w[x]:

((y'[x]^2 + 2 a y[x] + b y[x]^2 + 2/3 c y[x]^3 + d)/(6/c)^2 /. {y'[x] -> -(6/c) w'[x],
   y[x] -> -(6/c) w[x] - b/(2 c)} // Expand // Collect[#, {w[x]}] &) == 0
b^3/216 - (a b c)/36 + (c^2 d)/36 + (b^2/12 - (a c)/3) w[x] - 4 w[x]^3 + w'[x]^2 == 0

Now we can find the general solution with DSolve, although without the initial (boundary) conditions (this is a current arbitrary restriction in DSolve, perhaps in next versions of the system it will be improved):

DSolve[ b^3/216 - (a b c)/36 + (c^2 d)/36 + (b^2/12 -(a c)/3) w[x] - 4w[x]^3 
         + w'[x]^2 == 0, w[x], x]
{{w[x] -> WeierstrassP[x - C[1], 
                       {1/216 (18 b^2 - 72 a c), 1/216 (b^3 - 6 a b c + 6 c^2 d)}]},
 {w[x] -> WeierstrassP[x + C[1],
                       {1/216 (18 b^2 - 72 a c), 1/216 (b^3 - 6 a b c + 6 c^2 d)}]}}

Finally returning to the original dependent variable y[x] we define a new function being an explicit general solution in terms of all constants:

ys[x_, a_, b_, c_, C1_, d_] := -((12WeierstrassP[x - C1,
     {1/216 (18 b^2 - 72 a c), 1/216 (b^3 - 6 a b c + 6 c^2 d)}] + b)/(2 c))

Problem of determining the actual solution to the conditions given is more subtle and it cannot be given in general in an explicit form, unless we prescribe different initial (boundary) conditions. Parameters (constants of integration) d and C[1] should be found from the conditions given, nevertheless they are inconsistent with the differential equation. Elliptic functions are doubly periodic meromorphic functions in the complex plane, and so one cannot prescribe such conditions at infinity as it was supposed, unless we restrict to a special case. For more detailed discussion of the issue see e.g. Optimization of ODE with respect to the initial condition or Problem solving Third order non-linear differential equation in Mathematica. These posts demonstrate that we can solve the equation with respect to the initial conditions, although it is not guaranteed that we can relay only on symbolic functionality, it may appear that certain numeric assistance will be needed.

Special cases

a=0, b=0, d=0, C1=0

Recalling that WeierstrassP[x, {0, 0}] == 1/x^2 we can find a case where the given boundary conditions are satisfied.

ys[x, 0, 0, c, 0, 0]
-(6/(c x^2))

that yields:

With[{x = Infinity}, 
     {ys[x, 0, 0, c, 0, 0], Derivative[1, 0, 0, 0, 0, 0][ys][x, 0, 0, c, 0, 0]}]
 {0, 0}

It appears that in this case the equation can be solved immediately:

DSolveValue[{y''[x] + c y[x]^2 == 0}, y[x], x]
 (6^(1/3) WeierstrassP[((-c)^(1/3) (x + C[1]))/6^(1/3), {0, C[2]}])/(-c)^(1/3)
% /. {C[1] -> 0, C[2] -> 0}
 -(6/(c x^2))

a=1, b=2, c=-1, C1= -1/2, d= 3

This represents a tipical solution when C1 is real

ys[x, 1, 2, -1, -1/2, 3]
1/2 (2 + 12 WeierstrassP[1/2 + x, {2/3, 19/108}])

and it shows that conditons at infinity cannot be prescribed

Plot[ys[x, 1, 2, -1, -1/2, 3], {x, -2, 5}, PlotStyle -> Thick]

enter image description here

Answered by Artes on August 22, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP