With little help MMA can find general and particular solution
ode = x''[t] - (x'[t]^2 - 4*x[t]^4)/x[t]
A new variable x[t]=1/v[t]
:
xx[t_] := v[t]^(-1);
ode2 = FullSimplify[(ode /. x -> xx)*v[t]^3] // Expand
sol = DSolve[ode2 == 0, v[t], t]
$\left\{\left\{v(t)\to \frac{1}{2} e^{-e^{c_1} t-2 c_1-e^{c_1} c_2}
\left(e^{2 e^{c_1} \left(c_2+t\right)}+4 e^{2
c_1}\right)\right\},\left\{v(t)\to \frac{1}{2} \left(e^{-e^{c_1}
t-2 c_1-e^{c_1} c_2}+4 e^{e^{c_1} t+e^{c_1}
c_2}\right)\right\}\right\}$
Back substituting:
sol2 = x[t] -> 1/v[t] /. sol
$\left\{x(t)\to \frac{2 e^{e^{c_1} t+2 c_1+e^{c_1} c_2}}{e^{2 e^{c_1}
\left(c_2+t\right)}+4 e^{2 c_1}},x(t)\to \frac{2}{e^{-e^{c_1} t-2
c_1-e^{c_1} c_2}+4 e^{e^{c_1} t+e^{c_1} c_2}}\right\}$
Check the results, can be verified:
First and second solution :
(ode /. sol2[[1]] /. D[sol2[[1]], t] /. D[sol2[[1]], t, t]) ==
0 // FullSimplify
(*True*)
(ode /. sol2[[2]] /. D[sol2[[2]], t] /. D[sol2[[2]], t, t]) ==
0 // FullSimplify
(*True*)
Now You must find the constants c1
and c2
,numerically only.
Let's take the first solution of the equation sol2
and find constans:
sol3 = FindRoot[{(x[t] /. sol2[[1]] /. t -> 0 /. C[1] -> c1 /.
C[2] -> c2) ==
1, (x[t] /. sol2[[1]] /. t -> 1 /. C[1] -> c1 /. C[2] -> c2) ==
6/5}, {{c1, 0.1 - I}, {c2, 0.5 - I}}]
(*{c1 -> 0.979599 - 0.797296 I, c2 -> 0.138683 + 0.212765 I} *)
sol4 = sol2[[1]] /. C[1] -> c1 /. C[2] -> c2 /. sol3
$x(t)\to \frac{2 e^{(1.86076\, -1.90557 i) t+(2.62269\, -1.46296 i)}}{e^{(3.72152\, -3.81115
i) (t+(0.138683\, +0.212765 i))}+(-0.675155-28.3665 i)}$
Checks boundary conditions:
x[t] /. sol4 /. t -> 0
(* 1. - 5.55112*10^-17 I *)
x[t] /. sol4 /. t -> 1
(* 1.2 - 5.55112*10^-17 I*)
.
s = NDSolveValue[{x''[t] == (x'[t]^2 - 4 x[t]^4)/x[t], x[0] == 1,
x[1] == 1.2}, {x}, {t, -5, 8}];
In this case NDSolveValue
spit out Power::infy
and fails.
Plot[{Re@Evaluate[x[t] /. sol4], Evaluate@Through[s[t]]}, {t, -5, 8},
PlotRange -> All,
PlotLegends -> {"Solution with FindRoot", "NDSolve"}]
NDSolve
code, I obtain numerous error messages and a curve for whichx[0] == 0.5
. $\endgroup$