59.7.3 problem 14.1 (iii)

Internal problem ID [15048]
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 : Thursday, October 02, 2025 at 10:02:23 AM
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.004 (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 = \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.011 (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]
 
\begin{align*} x(t)&\to -\frac {3 e^{-t}}{2}+c_1 e^{-2 t}+c_2 e^t \end{align*}
Sympy. Time used: 0.092 (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} \]