29.6.7 problem 153

Internal problem ID [4753]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 6
Problem number : 153
Date solved : Tuesday, March 04, 2025 at 07:13:52 PM
CAS classification : [_linear]

\begin{align*} x y^{\prime }&=1+x +a y \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 31
ode:=x*diff(y(x),x) = 1+x+a*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \left (-\frac {x^{-a} \left (a x +a -1\right )}{a \left (a -1\right )}+c_{1} \right ) x^{a} \]
Mathematica. Time used: 1.123 (sec). Leaf size: 28
ode=x D[y[x],x]==1+x+a y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {a x+a-1}{(a-1) a}+c_1 x^a \]
Sympy. Time used: 0.277 (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 )} \]