23.1.515 problem 505

Internal problem ID [5122]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 505
Date solved : Tuesday, September 30, 2025 at 11:42:51 AM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} \left (a x +b y\right ) y^{\prime }&=b x +a y \end{align*}
Maple. Time used: 0.100 (sec). Leaf size: 48
ode:=(a*x+b*y(x))*diff(y(x),x) = b*x+a*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x \left ({\mathrm e}^{\operatorname {RootOf}\left ({\mathrm e}^{\textit {\_Z}}-x^{\frac {2 b}{a -b}} {\mathrm e}^{\frac {2 c_1 b +\textit {\_Z} a +\textit {\_Z} b}{a -b}}+2\right )}+1\right ) \]
Mathematica. Time used: 0.024 (sec). Leaf size: 48
ode=(a*x+b*y[x])*D[y[x],x]==b*x+a*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {1}{2} (a+b) \log \left (1-\frac {y(x)}{x}\right )+\frac {1}{2} (b-a) \log \left (\frac {y(x)}{x}+1\right )=-b \log (x)+c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a*y(x) - b*x + (a*x + b*y(x))*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
RecursionError : maximum recursion depth exceeded