29.8.29 problem 234

Internal problem ID [4834]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 8
Problem number : 234
Date solved : Tuesday, March 04, 2025 at 07:21:41 PM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (sec). Leaf size: 15
ode:=(x+a)*diff(y(x),x) = y(x)*(1-a*y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {x +a}{a x +c_{1}} \]
Mathematica. Time used: 0.721 (sec). Leaf size: 34
ode=(a+x) D[y[x],x]==y[x](1-a y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {a+x}{a^2+a x+e^{c_1}} \\ y(x)\to 0 \\ y(x)\to \frac {1}{a} \\ \end{align*}
Sympy. Time used: 0.344 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq((a + x)*Derivative(y(x), x) - (-a*y(x) + 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {1 + \frac {x}{a}}{C_{1} + a + x} \]