73.1.19 problem 4 (i)

Internal problem ID [19792]
Book : Elementary Differential Equations. By R.L.E. Schwarzenberger. Chapman and Hall. London. First Edition (1969)
Section : Chapter 3. Solutions of first-order equations. Exercises at page 47
Problem number : 4 (i)
Date solved : Thursday, October 02, 2025 at 04:43:43 PM
CAS classification : [[_linear, `class A`]]

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