63.9.21 problem 4

Internal problem ID [13069]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 2, Second order linear equations. Section 2.3.1 Nonhomogeneous Equations: Undetermined Coefficients. Exercises page 110
Problem number : 4
Date solved : Wednesday, March 05, 2025 at 09:14:36 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

\begin{align*} x \left (0\right )&=0\\ x^{\prime }\left (0\right )&=1 \end{align*}

Maple. Time used: 0.019 (sec). Leaf size: 24
ode:=diff(diff(x(t),t),t)-3*diff(x(t),t)-40*x(t) = 2*exp(-t); 
ic:=x(0) = 0, D(x)(0) = 1; 
dsolve([ode,ic],x(t), singsol=all);
 
\[ x \left (t \right ) = \frac {\left (22 \,{\mathrm e}^{13 t}-13 \,{\mathrm e}^{4 t}-9\right ) {\mathrm e}^{-5 t}}{234} \]
Mathematica. Time used: 0.02 (sec). Leaf size: 30
ode=D[x[t],{t,2}]-3*D[x[t],t]-40*x[t]==2*Exp[-t]; 
ic={x[0]==0,Derivative[1][x][0 ]==1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {1}{234} e^{-5 t} \left (-13 e^{4 t}+22 e^{13 t}-9\right ) \]
Sympy. Time used: 0.241 (sec). Leaf size: 26
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-40*x(t) - 3*Derivative(x(t), t) + Derivative(x(t), (t, 2)) - 2*exp(-t),0) 
ics = {x(0): 0, Subs(Derivative(x(t), t), t, 0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \frac {11 e^{8 t}}{117} - \frac {e^{- t}}{18} - \frac {e^{- 5 t}}{26} \]