51.1.7 problem 7

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

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