29.8.27 problem 232

Internal problem ID [4832]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 8
Problem number : 232
Date solved : Sunday, March 30, 2025 at 04:02:46 AM
CAS classification : [_separable]

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

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