80.5.32 problem C 8

Internal problem ID [21253]
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 8
Date solved : Thursday, October 02, 2025 at 07:27:21 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{\prime \prime }-3 x^{\prime }-x&=t^{2}+t \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 36
ode:=diff(diff(x(t),t),t)-3*diff(x(t),t)-x(t) = t^2+t; 
dsolve(ode,x(t), singsol=all);
 
\[ x = {\mathrm e}^{\frac {\left (3+\sqrt {13}\right ) t}{2}} c_2 +{\mathrm e}^{-\frac {\left (-3+\sqrt {13}\right ) t}{2}} c_1 -t^{2}+5 t -17 \]
Mathematica. Time used: 0.016 (sec). Leaf size: 49
ode=D[x[t],{t,2}]-3*D[x[t],t]-x[t]==t^2+t; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -t^2+5 t+c_1 e^{-\frac {1}{2} \left (\sqrt {13}-3\right ) t}+c_2 e^{\frac {1}{2} \left (3+\sqrt {13}\right ) t}-17 \end{align*}
Sympy. Time used: 0.121 (sec). Leaf size: 37
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t**2 - t - x(t) - 3*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^{\frac {t \left (3 - \sqrt {13}\right )}{2}} + C_{2} e^{\frac {t \left (3 + \sqrt {13}\right )}{2}} - t^{2} + 5 t - 17 \]