51.1.8 problem 8

Internal problem ID [10278]
Book : First order enumerated odes
Section : section 1
Problem number : 8
Date solved : Tuesday, September 30, 2025 at 07:16:29 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }&=a x +b y \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 24
ode:=diff(y(x),x) = a*x+b*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {a x}{b}-\frac {a}{b^{2}}+{\mathrm e}^{b x} c_1 \]
Mathematica. Time used: 0.041 (sec). Leaf size: 32
ode=D[y[x],x]==a*x+b*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{b x} \left (\int _1^xa e^{-b K[1]} K[1]dK[1]+c_1\right ) \end{align*}
Sympy. Time used: 0.075 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a*x - b*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{b x} - \frac {a x}{b} - \frac {a}{b^{2}} \]