57.1.7 problem 7

Internal problem ID [8991]
Book : First order enumerated odes
Section : section 1
Problem number : 7
Date solved : Wednesday, March 05, 2025 at 07:13:54 AM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.002 (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.03 (sec). Leaf size: 18
ode=D[y[x],x]==a*x+y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -a (x+1)+c_1 e^x \]
Sympy. Time used: 0.112 (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 \]