# exact solution for first-order nonlinear ordinary differential equation [closed]

I was trying to solve this non-linear first ODE

Clear["Global*"]
eqns = {a*Derivative[1][y][x]^2 - b*Derivative[1][y][x]*Sqrt[3*Derivative[1][y][x]^2 - f*y[x]^2 + 3] - a*f*y[x]^2 + (a - 2/3) == 0, y[1] == y0}
sol = ParametricNDSolve[eqns, {y}, {x, 0, 10}, {a, b, f, y0},
WorkingPrecision -> 20];
Manipulate[Plot[Evaluate[y[a, b, f, y0][x] /. sol], {x, 0, 10},PlotStyle -> Red], {{a, 1}, 0, 2, 0.2, Appearance -> "Labeled"},{{b, 0.3}, .1, 1, 0.1, Appearance -> "Labeled"}, {{f, 1}, 1, 100, 5, Appearance -> "Labeled"}, {{y0, 1}, 1, 10, 1, Appearance -> "Labeled"}]


I don't know why what is wrong here. Also I don't think so it has an analytical solution.

• There seems to be nothing wrong with your code. It works on my machine. What problems do you have specifically? Dec 21 '21 at 16:19
• I don't think so it has an analytical solution V13 DSolve gives answer in terms of integrals. If you have specific values for f and a may be it can evaluate these integrals. Dec 21 '21 at 16:19
• Try with a new kernel. Dec 21 '21 at 16:19
• The integrals are hard to solve analytically. But it does give solutions in terms of them. So this become an integration problem really. You can try plugging in some values for a,b,f and see if you can get explicit solution. May be for some values these integrals can be solved. I do not know. use Manipulate to try different values? Dec 21 '21 at 16:34
• DSolve[] produces something akin to a hyperelliptic integral, which do not have closed forms known to Mathematica in general. That those also need to be inverted afterwards (note the use of InverseFunction[]) does not help matters. Dec 21 '21 at 16:41

The Manipulate controls provide machine precision parameters, the precision should be increased consistent with the precision used in the ParametricNDSolve before their use.

Also, depending on the parameter values, a different plot type may be more appropriate.

Clear["Global*"]
eqns = {a*Derivative[1][y][x]^2 -
b*Derivative[1][y][x]*Sqrt[3*Derivative[1][y][x]^2 - f*y[x]^2 + 3] -
a*f*y[x]^2 + (a - 2/3) == 0, y[1] == y0};

sol = ParametricNDSolve[eqns, y, {x, 0, 10}, {a, b, f, y0},
WorkingPrecision -> 20];

Manipulate[
plt[
Evaluate[(y @@ SetPrecision[{a, b, f, y0}, 20])[x] /. sol],
{x, 0, 10},
PlotStyle -> Red,
WorkingPrecision -> 20],
{{a, 1}, 0, 2, 0.2, Appearance -> "Labeled"},
{{b, 0.3}, .1, 1, 0.1, Appearance -> "Labeled"},
{{f, 1}, 1, 100, 5, Appearance -> "Labeled"},
{{y0, 1}, 1, 10, 1, Appearance -> "Labeled"},
Delimiter,
{{plt, Plot, "Plot Type"},
{Plot, LogLinearPlot, LogLogPlot}}]