84.15.7 problem 8.7

Internal problem ID [22179]
Book : Schaums outline series. Differential Equations By Richard Bronson. 1973. McGraw-Hill Inc. ISBN 0-07-008009-7
Section : Chapter 8. Linear first-order differential equations. Solved problems. Page 33
Problem number : 8.7
Date solved : Thursday, October 02, 2025 at 08:33:30 PM
CAS classification : [_separable]

\begin{align*} y^{\prime }+y x&=x y^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 16
ode:=diff(y(x),x)+x*y(x) = x*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {1}{1+{\mathrm e}^{\frac {x^{2}}{2}} c_1} \]
Mathematica. Time used: 0.146 (sec). Leaf size: 31
ode=D[y[x],x]+x*y[x]==x*y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{1+e^{\frac {x^2}{2}+c_1}}\\ y(x)&\to 0\\ y(x)&\to 1 \end{align*}
Sympy. Time used: 1.398 (sec). Leaf size: 53
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 )} = \frac {\sqrt {e^{2 C_{1} + x^{2}}} - 1}{e^{2 C_{1} + x^{2}} - 1}, \ y{\left (x \right )} = - \frac {\sqrt {e^{2 C_{1} + x^{2}}} + 1}{e^{2 C_{1} + x^{2}} - 1}\right ] \]