# How to solve Nonlinear coupled ODEs using DSolve

I cannot solve such a system of coupled ODEs in MMA 12.1 using DSolve.

i.e. output is equal to the input equations ... (see the attached figure) Here, each solution is labeled according to the name of the function x and the function y, individual functions look like:

L=10;
DSolve[{y''[t]==0,y==0,x[L]^2*Derivative[y][L]==100,-1+x[t]+x[t]*(Derivative[y][t]^2+y''[t]^2)-2 x''[t]==0,Derivative[x]==0,Derivative[x][L]==0},{y,x},t] I need the analytical expression, and the numerical solution can be used for verification, but NDSolve does not convergence.

The problem with the initial/B.C. conditions. It does not look like there is a real solution that satisfies them.

This below solves the ODE's and give 3 equations in 3 constants of integrations.

If it is possible to solve these 3 equations, then you can obtain the general solution. But Mathematica says there is no real solution. So may be you should examine how you obtained these ODE's with such BC.

Solve the first ode on its own, with one IC only.

Take this solution and plug it into the second ODE. Then solve the resulting second ODE with no IC's.

So now the solution for the second ODE contains 3 constants of integrations. One from the first solution (since we only used one IC there) and two from the second ODE since we did not use any IC.

Now setup 3 equations using those not used IC's. And try to solve them.

ClearAll[y, x, t];
L = 10;
ode1 = y''[t] == 0;
ic11 = y == 0;
ic12 = x[L]^2*y'[L] == 100;
soly = DSolve[{ode1, ic11}, y, t][[1, 1]] ode2 = -1 + x[t] + x[t]*(y'[t]^2 + y''[t]^2) - 2 x''[t] == 0;
ode2 = ode2 /. soly ic12 = ic12 /. soly ic21 = x' == 0
ic22 = x'[L] == 0
solx = DSolve[ode2, x, t][[1, 1]] Now setup 3 equations from the 3 remaining IC's

 eq1 = ic12 /. solx eq2 = ic21 /. solx eq3 = ic22 /. solx Solve[{eq1, eq2, eq3}, {C, C, C}]
(* waited too long *)

Solve[{eq1, eq2, eq3}, {C, C, C}, Reals]
(* {} *)


So the problem is now is changed to solving 3 equations in 3 unknowns. If you can solve these equations, then you have your solution. FindInstance can find one solution

solIC = FindInstance[{eq1, eq2, eq3}, {C, C, C}]
N[solIC]

(* {{C -> -0.0353443 - 1.03537 I, C -> 0., C -> 0.}} *)


So that is one solution. Hence the solutions are

soly /. solIC solx /. solIC Which is the same as Verify the solutions:

ode1 /. soly
(*True*)
ode2 /. solx /. solIC
(*True*)


Also, all IC's are verified true.

So bottom line is, the solutions are

  y(t) = t (-0.0353443 - 1.03537 I)
x(t) = -(1/(-1 - (-0.0353443 - 1.03537 I)^2))


I think DSolve could not solve it, since it could not find solution using Solve for the constants of integrations.

Noticed also NDSolve have hard time with your BC/IC

ClearAll[y, x, t];
L = 10;
ode1 = y''[t] == 0;
ic11 = y == 0;
ic12 = x[L]^2*y'[L] == 100;
ode2 = -1 + x[t] + x[t]*(y'[t]^2 + y''[t]^2) - 2 x''[t] == 0;
ic21 = x' == 0;
ic22 = x'[L] == 0;
NDSolve[{ode1, ode2, ic11, ic12, ic21, ic22}, {x, y}, {t, 0, 1}] • why Solve[{eq1, eq2, eq3}, {C, C, C}] does not work in MMA? I wait one hour but still not be solve.... – ABCDEMMM Jul 20 at 15:31
• @ABCDEMMM as I mentioned in the answer, it did not work for me. I do not know why Solve does not work but FindInstance does. Must be due to different algorithms used. – Nasser Jul 20 at 16:52
• "NDSolve have hard time..." is the numerical results from MMA for this problem correct? – ABCDEMMM Jul 20 at 21:26
• is the numerical results from MMA for this problem correct? well, correct is relative term here. If you see a very small imaginary number left after you use the result from FindInstance, you could try Chop on it. Since FindInstance returns numerical, not exact number. This is the best that Mathematica could do. Maple can not solve this either exactly. – Nasser Jul 20 at 22:55

It seems that the equations has no explicit solution, we should use NDSolve or NDSolveValue

Clear["*"];
Clear[Derivative];
L = 10;
sol = NDSolve[{y''[t] ==
0, -1 + x[t] + x[t]*(y'[t]^2 + y''[t]^2) - 2 x''[t] == 0,
x' == 0, x'[L] == 0, y == 0, x[L]^2*y'[L] == 100}, {y,
x}, {t, -5, 5}]
ParametricPlot[{x[t], y[t]} /. sol, {t, -5, 5},
AspectRatio -> Automatic]
`
• first thank you! But the results does not convergence using NDSolve. I also need the analytical expression. – ABCDEMMM Jul 20 at 14:27