30.5.23 problem 23

Internal problem ID [7522]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.6, Substitutions and Transformations. Exercises. page 76
Problem number : 23
Date solved : Tuesday, September 30, 2025 at 04:41:52 PM
CAS classification : [[_homogeneous, `class G`], _rational, _Bernoulli]

\begin{align*} y^{\prime }&=\frac {2 y}{x}-x^{2} y^{2} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 18
ode:=diff(y(x),x) = 2*y(x)/x-x^2*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {5 x^{2}}{x^{5}+5 c_1} \]
Mathematica. Time used: 0.084 (sec). Leaf size: 25
ode=D[y[x],x]==2*y[x]/x-x^2*y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {5 x^2}{x^5+5 c_1}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 0.122 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*y(x)**2 + Derivative(y(x), x) - 2*y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {5 x^{2}}{C_{1} + x^{5}} \]