56.7.2 problem Ex 2

Internal problem ID [14106]
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 14. Equations reducible to linear equations (Bernoulli). Page 21
Problem number : Ex 2
Date solved : Thursday, October 02, 2025 at 09:13:47 AM
CAS classification : [_separable]

\begin{align*} y y^{\prime }+x y^{2}&=x \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 33
ode:=y(x)*diff(y(x),x)+x*y(x)^2 = x; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {{\mathrm e}^{-x^{2}} c_1 +1} \\ y &= -\sqrt {{\mathrm e}^{-x^{2}} c_1 +1} \\ \end{align*}
Mathematica. Time used: 1.844 (sec). Leaf size: 57
ode=y[x]*D[y[x],x]+x*y[x]^2==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\sqrt {1+e^{-x^2+2 c_1}}\\ y(x)&\to \sqrt {1+e^{-x^2+2 c_1}}\\ y(x)&\to -1\\ y(x)&\to 1 \end{align*}
Sympy. Time used: 0.364 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x)**2 - x + y(x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {C_{1} e^{- x^{2}} + 1}, \ y{\left (x \right )} = \sqrt {C_{1} e^{- x^{2}} + 1}\right ] \]