23.1.156 problem 156

Internal problem ID [4763]
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 : 156
Date solved : Tuesday, September 30, 2025 at 08:30:47 AM
CAS classification : [_linear]

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