79.1.19 problem 4 (i)

Internal problem ID [18427]
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, March 13, 2025 at 11:56:46 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} x^{\prime }+2 x&={\mathrm e}^{t} \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 18
ode:=diff(x(t),t)+2*x(t) = exp(t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = \frac {\left ({\mathrm e}^{3 t}+3 c_{1} \right ) {\mathrm e}^{-2 t}}{3} \]
Mathematica. Time used: 0.042 (sec). Leaf size: 21
ode=D[x[t],t]+2*x[t]==Exp[t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {e^t}{3}+c_1 e^{-2 t} \]
Sympy. Time used: 0.123 (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} \]