29.8.24 problem 229

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

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

Maple. Time used: 0.001 (sec). Leaf size: 22
ode:=(x+a)*diff(y(x),x) = b*x+y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = b \left (x +a \right ) \ln \left (x +a \right )+\left (b +c_{1} \right ) a +c_{1} x \]
Mathematica. Time used: 0.048 (sec). Leaf size: 27
ode=(a+x) D[y[x],x]==b x+ y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to (a+x) \left (-\frac {b x}{a+x}+b \log (a+x)+c_1\right ) \]
Sympy. Time used: 0.286 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-b*x + (a + x)*Derivative(y(x), x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} a + C_{1} x + a b \log {\left (a + x \right )} + a b + b x \log {\left (a + x \right )} \]