59.7.12 problem 14.2

Internal problem ID [15057]
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.2
Date solved : Thursday, October 02, 2025 at 10:02:29 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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