82.10.1 problem Ex. 1

Internal problem ID [18677]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter II. Equations of the first order and of the first degree. Exercises at page 27
Problem number : Ex. 1
Date solved : Thursday, March 13, 2025 at 12:37:12 PM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 31
ode:=x*diff(y(x),x)-a*y(x) = 1+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: 0.069 (sec). Leaf size: 21
ode=a*D[y[x],x]-a*y[x]==x+1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {-a c_1 e^x+x+2}{a} \]
Sympy. Time used: 0.270 (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 )} \]