40.4.15 problem 19 (q)

Internal problem ID [6655]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 6. Equations of first order and first degree (Linear equations). Supplemetary problems. Page 39
Problem number : 19 (q)
Date solved : Wednesday, March 05, 2025 at 01:35:15 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

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

Maple. Time used: 0.002 (sec). Leaf size: 23
ode:=2+y(x)^2-(x*y(x)+2*y(x)+y(x)^3)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ x -y^{2}-2-\sqrt {y^{2}+2}\, c_1 = 0 \]
Mathematica. Time used: 5.572 (sec). Leaf size: 189
ode=(2+y[x]^2)-(x*y[x]+2*y[x]+y[x]^3)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\sqrt {2 x-\sqrt {4 c_1{}^2 x+c_1{}^4}-4+c_1{}^2}}{\sqrt {2}} \\ y(x)\to \frac {\sqrt {2 x-\sqrt {4 c_1{}^2 x+c_1{}^4}-4+c_1{}^2}}{\sqrt {2}} \\ y(x)\to -\frac {\sqrt {2 x+\sqrt {4 c_1{}^2 x+c_1{}^4}-4+c_1{}^2}}{\sqrt {2}} \\ y(x)\to \frac {\sqrt {2 x+\sqrt {4 c_1{}^2 x+c_1{}^4}-4+c_1{}^2}}{\sqrt {2}} \\ y(x)\to -i \sqrt {2} \\ y(x)\to i \sqrt {2} \\ \end{align*}
Sympy. Time used: 53.608 (sec). Leaf size: 112
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-x*y(x) - y(x)**3 - 2*y(x))*Derivative(y(x), x) + y(x)**2 + 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {\frac {C_{1}^{2}}{2} - \frac {C_{1} \sqrt {C_{1}^{2} + 4 x}}{2} + x - 2}, \ y{\left (x \right )} = \sqrt {\frac {C_{1}^{2}}{2} - \frac {C_{1} \sqrt {C_{1}^{2} + 4 x}}{2} + x - 2}, \ y{\left (x \right )} = - \sqrt {\frac {C_{1}^{2}}{2} + \frac {C_{1} \sqrt {C_{1}^{2} + 4 x}}{2} + x - 2}, \ y{\left (x \right )} = \sqrt {\frac {C_{1}^{2}}{2} + \frac {C_{1} \sqrt {C_{1}^{2} + 4 x}}{2} + x - 2}\right ] \]