9.6.21 problem 21

Internal problem ID [2978]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 10, page 41
Problem number : 21
Date solved : Tuesday, September 30, 2025 at 06:13:34 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

\begin{align*} y+y^{3}+4 \left (x y^{2}-1\right ) y^{\prime }&=0 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.113 (sec). Leaf size: 34
ode:=y(x)+y(x)^3+4*(x*y(x)^2-1)*diff(y(x),x) = 0; 
ic:=[y(0) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = {\mathrm e}^{\operatorname {RootOf}\left (-{\mathrm e}^{4 \textit {\_Z}} x -2 \,{\mathrm e}^{2 \textit {\_Z}} x +2 \,{\mathrm e}^{2 \textit {\_Z}}+4 \textit {\_Z} -x -2\right )} \]
Mathematica. Time used: 0.137 (sec). Leaf size: 37
ode=(y[x]+y[x]^3)+4*(x*y[x]^2-1)*D[y[x],x]==0; 
ic={y[0]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=\frac {2 y(x)^2+4 \log (y(x))}{\left (y(x)^2+1\right )^2}-\frac {2}{\left (y(x)^2+1\right )^2},y(x)\right ] \]
Sympy. Time used: 0.575 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((4*x*y(x)**2 - 4)*Derivative(y(x), x) + y(x)**3 + y(x),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ x \left (y^{4}{\left (x \right )} + 2 y^{2}{\left (x \right )} + 1\right ) - 2 y^{2}{\left (x \right )} - 4 \log {\left (y{\left (x \right )} \right )} + 2 = 0 \]