80.5.50 problem C 27

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

\begin{align*} x^{\prime \prime }-2 x&=2 \,{\mathrm e}^{t} \end{align*}

With initial conditions

\begin{align*} x \left (0\right )&=0 \\ x \left (a \right )&=0 \\ \end{align*}
Maple. Time used: 0.128 (sec). Leaf size: 80
ode:=diff(diff(x(t),t),t)-2*x(t) = 2*exp(t); 
ic:=[x(0) = 0, x(a) = 0]; 
dsolve([ode,op(ic)],x(t), singsol=all);
 
\[ x = \frac {2 \,{\mathrm e}^{\left (2 a -t \right ) \sqrt {2}}+2 \,{\mathrm e}^{\left (a +t \right ) \sqrt {2}+a}-2 \,{\mathrm e}^{2 \sqrt {2}\, a +t}+2 \,{\mathrm e}^{t}-2 \,{\mathrm e}^{\left (a -t \right ) \sqrt {2}+a}-2 \,{\mathrm e}^{\sqrt {2}\, t}}{{\mathrm e}^{2 \sqrt {2}\, a}-1} \]
Mathematica. Time used: 0.028 (sec). Leaf size: 106
ode=D[x[t],{t,2}]-2*x[t]==2*Exp[t]; 
ic={x[0]==0,x[a] == 0}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to -\frac {2 \left (e^{\sqrt {2} (2 a-t)}-e^{2 \sqrt {2} a+t}-e^{\sqrt {2} a+a-\sqrt {2} t}+e^{\sqrt {2} a+a+\sqrt {2} t}+e^t-e^{\sqrt {2} t}\right )}{1-e^{2 \sqrt {2} a}} \end{align*}
Sympy. Time used: 0.074 (sec). Leaf size: 112
from sympy import * 
t = symbols("t") 
a = symbols("a") 
x = Function("x") 
ode = Eq(-2*x(t) - 2*exp(t) + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 0, x(a): 0} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \left (- \frac {2 e^{a} e^{\sqrt {2} a}}{e^{2 \sqrt {2} a} - 1} + \frac {2 e^{2 \sqrt {2} a}}{e^{2 \sqrt {2} a} - 1}\right ) e^{- \sqrt {2} t} + \left (\frac {2 e^{a} e^{\sqrt {2} a}}{e^{2 \sqrt {2} a} - 1} - \frac {2}{e^{2 \sqrt {2} a} - 1}\right ) e^{\sqrt {2} t} - 2 e^{t} \]