80.5.48 problem C 24

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

\begin{align*} x^{\prime \prime }-x&=t \end{align*}

With initial conditions

\begin{align*} x \left (0\right )&=0 \\ x \left (1\right )&=0 \\ \end{align*}
Maple. Time used: 0.045 (sec). Leaf size: 13
ode:=diff(diff(x(t),t),t)-x(t) = t; 
ic:=[x(0) = 0, x(1) = 0]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = -t +\operatorname {csch}\left (1\right ) \sinh \left (t \right ) \]
Mathematica. Time used: 0.012 (sec). Leaf size: 38
ode=D[x[t],{t,2}]-x[t]==t; 
ic={x[0]==0,x[1]==0}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {e^2 t-t+e^{1-t}-e^{t+1}}{1-e^2} \end{align*}
Sympy. Time used: 0.047 (sec). Leaf size: 27
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t - x(t) + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 0, x(1): 0} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = - t + \frac {e e^{t}}{-1 + e^{2}} - \frac {e e^{- t}}{-1 + e^{2}} \]