80.5.34 problem C 10

Internal problem ID [21255]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 5. Second order equations. Excercise 5.9 at page 119
Problem number : C 10
Date solved : Thursday, October 02, 2025 at 07:27:22 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{\prime \prime }-x^{\prime }-2 x&=2 t +{\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) = 2*t+exp(t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = {\mathrm e}^{2 t} c_2 +{\mathrm e}^{-t} c_1 -\frac {{\mathrm e}^{t}}{2}-t +\frac {1}{2} \]
Mathematica. Time used: 0.147 (sec). Leaf size: 35
ode=D[x[t],{t,2}]-D[x[t],t]-2*x[t]==2*t+Exp[t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -t-\frac {e^t}{2}+c_1 e^{-t}+c_2 e^{2 t}+\frac {1}{2} \end{align*}
Sympy. Time used: 0.119 (sec). Leaf size: 24
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-2*t - 2*x(t) - exp(t) - Derivative(x(t), t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} e^{- t} + C_{2} e^{2 t} - t - \frac {e^{t}}{2} + \frac {1}{2} \]