80.5.40 problem C 16

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

\begin{align*} x^{\prime \prime }-x&={\mathrm e}^{k t} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 27
ode:=diff(diff(x(t),t),t)-x(t) = exp(k*t); 
dsolve(ode,x(t), singsol=all);
 
\[ x = {\mathrm e}^{t} c_2 +{\mathrm e}^{-t} c_1 +\frac {{\mathrm e}^{k t}}{k^{2}-1} \]
Mathematica. Time used: 0.072 (sec). Leaf size: 37
ode=D[x[t],{t,2}]-x[t]==Exp[k*t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to e^{-t} \left (\frac {e^{(k+1) t}}{k^2-1}+c_1 e^{2 t}+c_2\right ) \end{align*}
Sympy. Time used: 0.044 (sec). Leaf size: 22
from sympy import * 
t = symbols("t") 
k = symbols("k") 
x = Function("x") 
ode = Eq(-x(t) - exp(k*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^{t} + \frac {e^{k t}}{k^{2} - 1} \]