69.4.17 problem 62

Internal problem ID [18006]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 4. Equations with variables separable and equations reducible to them. Exercises page 38
Problem number : 62
Date solved : Thursday, October 02, 2025 at 02:33:09 PM
CAS classification : [_linear]

\begin{align*} x y^{\prime }+y&=a \left (y x +1\right ) \end{align*}

With initial conditions

\begin{align*} y \left (\frac {1}{a}\right )&=-a \\ \end{align*}
Maple. Time used: 0.015 (sec). Leaf size: 9
ode:=x*diff(y(x),x)+y(x) = a*(x*y(x)+1); 
ic:=[y(1/a) = -a]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\frac {1}{x} \]
Mathematica. Time used: 0.024 (sec). Leaf size: 10
ode=y[x]+x*D[y[x],x]==a*(1+x*y[x]); 
ic={y[1/a]==-a}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{x} \end{align*}
Sympy. Time used: 0.185 (sec). Leaf size: 7
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-a*(x*y(x) + 1) + x*Derivative(y(x), x) + y(x),0) 
ics = {y(1/a): -a} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {1}{x} \]