14.3.1 problem Problem 1

Internal problem ID [3610]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.6, First-Order Linear Differential Equations. page 59
Problem number : Problem 1
Date solved : Tuesday, September 30, 2025 at 06:48:31 AM
CAS classification : [[_linear, `class A`]]

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