65.7.3 problem 14.1 (iii)

Internal problem ID [13688]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 14, Inhomogeneous second order linear equations. Exercises page 140
Problem number : 14.1 (iii)
Date solved : Wednesday, March 05, 2025 at 10:12:07 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.006 (sec). Leaf size: 25
ode:=diff(diff(x(t),t),t)+diff(x(t),t)-2*x(t) = 3*exp(-t); 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = \frac {\left (2 c_{1} {\mathrm e}^{3 t}-3 \,{\mathrm e}^{t}+2 c_{2} \right ) {\mathrm e}^{-2 t}}{2} \]
Mathematica. Time used: 0.019 (sec). Leaf size: 29
ode=D[x[t],{t,2}]+D[x[t],t]-2*x[t]==3*Exp[-t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to -\frac {3 e^{-t}}{2}+c_1 e^{-2 t}+c_2 e^t \]
Sympy. Time used: 0.157 (sec). Leaf size: 20
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-2*x(t) + Derivative(x(t), t) + Derivative(x(t), (t, 2)) - 3*exp(-t),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} e^{- 2 t} + C_{2} e^{t} - \frac {3 e^{- t}}{2} \]