75.4.17 problem 62

Internal problem ID [16648]
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 : Monday, March 31, 2025 at 03:03:31 PM
CAS classification : [_linear]

\begin{align*} y+x y^{\prime }&=a \left (1+x y\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*(1+x*y(x)); 
ic:=y(1/a) = -a; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {1}{x} \]
Mathematica. Time used: 0.036 (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]
 
\[ y(x)\to -\frac {1}{x} \]
Sympy. Time used: 0.290 (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} \]