65.7.12 problem 14.2

Internal problem ID [13697]
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 : Wednesday, March 05, 2025 at 10:13:04 PM
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.006 (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 \left (t \right ) = -2 \,{\mathrm e}^{-2 t} \left (\left (t -\frac {c_{1}}{2}-\frac {1}{3}\right ) {\mathrm e}^{3 t}-\frac {c_{2}}{2}+3 \,{\mathrm e}^{t}\right ) \]
Mathematica. Time used: 0.18 (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]
 
\[ 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 ) \]
Sympy. Time used: 0.194 (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} \]