7.18.3 problem 3

Internal problem ID [532]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 4. Laplace transform methods. Section 4.2 (Transformation of initial value problems). Problems at page 287
Problem number : 3
Date solved : Tuesday, March 04, 2025 at 11:26:15 AM
CAS classification : [[_2nd_order, _missing_x]]

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

Using Laplace method With initial conditions

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

Maple. Time used: 0.194 (sec). Leaf size: 17
ode:=diff(diff(x(t),t),t)-diff(x(t),t)-2*x(t) = 0; 
ic:=x(0) = 0, D(x)(0) = 2; 
dsolve([ode,ic],x(t),method='laplace');
 
\[ x \left (t \right ) = \frac {2 \,{\mathrm e}^{2 t}}{3}-\frac {2 \,{\mathrm e}^{-t}}{3} \]
Mathematica. Time used: 0.013 (sec). Leaf size: 21
ode=D[x[t],{t,2}]-D[x[t],t]-2*x[t]==0; 
ic={x[0]==0,Derivative[1][x][0] ==2}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {2}{3} e^{-t} \left (e^{3 t}-1\right ) \]
Sympy. Time used: 0.170 (sec). Leaf size: 17
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-2*x(t) - Derivative(x(t), t) + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 0, Subs(Derivative(x(t), t), t, 0): 2} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \frac {2 e^{2 t}}{3} - \frac {2 e^{- t}}{3} \]