62.5.1 problem Ex 1

Internal problem ID [12745]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter 2, differential equations of the first order and the first degree. Article 12. Page 18
Problem number : Ex 1
Date solved : Monday, March 31, 2025 at 07:01:35 AM
CAS classification : [[_homogeneous, `class G`], _rational, _Riccati]

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

Maple. Time used: 0.004 (sec). Leaf size: 21
ode:=y(x)+2*x*y(x)^2-x^2*y(x)^3+2*x^2*y(x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= 0 \\ y &= \frac {\tanh \left (-\frac {\ln \left (x \right )}{2}+\frac {c_1}{2}\right )}{x} \\ \end{align*}
Mathematica. Time used: 0.931 (sec). Leaf size: 71
ode=(y[x]+2*x*y[x]^2-x^2*y[x]^3)+(2*x^2*y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to 0 \\ y(x)\to \frac {i \tan \left (\frac {1}{2} i \log (x)+c_1\right )}{x} \\ y(x)\to 0 \\ y(x)\to \frac {-x+e^{2 i \text {Interval}[\{0,\pi \}]}}{x^2+x e^{2 i \text {Interval}[\{0,\pi \}]}} \\ \end{align*}
Sympy. Time used: 0.772 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*y(x)**3 + 2*x**2*y(x)*Derivative(y(x), x) + 2*x*y(x)**2 + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {i \tan {\left (C_{1} + \frac {i \log {\left (x \right )}}{2} \right )}}{x}, \ y{\left (x \right )} = 0\right ] \]