29.19.12 problem 525

Internal problem ID [5121]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 19
Problem number : 525
Date solved : Sunday, March 30, 2025 at 06:41:39 AM
CAS classification : [_separable]

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

Maple. Time used: 0.010 (sec). Leaf size: 47
ode:=x*(y(x)+a)*diff(y(x),x) = y(x)*(B*x+A); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{\frac {A}{a}} {\mathrm e}^{\frac {B x -a \operatorname {LambertW}\left (\frac {x^{\frac {A}{a}} {\mathrm e}^{\frac {B x +c_1}{a}}}{a}\right )+c_1}{a}} \]
Mathematica. Time used: 1.056 (sec). Leaf size: 39
ode=x(a+y[x])D[y[x],x]==y[x](A+B x); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to a W\left (\frac {x^{\frac {A}{a}} e^{\frac {-a+B x+c_1}{a}}}{a}\right ) \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.548 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
A = symbols("A") 
B = symbols("B") 
a = symbols("a") 
y = Function("y") 
ode = Eq(x*(a + y(x))*Derivative(y(x), x) - (A + B*x)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = a W\left (\frac {e^{\frac {A \log {\left (x \right )} + B x + C_{1}}{a}}}{a}\right ) \]