63.15.1 problem 6(a)

Internal problem ID [13105]
Book : A First Course in Differential Equations by J. David Logan. Third Edition. Springer-Verlag, NY. 2015.
Section : Chapter 3, Laplace transform. Section 3.2.1 Initial value problems. Exercises page 156
Problem number : 6(a)
Date solved : Wednesday, March 05, 2025 at 09:17:24 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} x^{\prime }+5 x&=\operatorname {Heaviside}\left (t -2\right ) \end{align*}

Using Laplace method With initial conditions

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

Maple. Time used: 21.588 (sec). Leaf size: 27
ode:=diff(x(t),t)+5*x(t) = Heaviside(t-2); 
ic:=x(0) = 1; 
dsolve([ode,ic],x(t),method='laplace');
 
\[ x \left (t \right ) = -\frac {\operatorname {Heaviside}\left (t -2\right ) {\mathrm e}^{-5 t +10}}{5}+\frac {\operatorname {Heaviside}\left (t -2\right )}{5}+{\mathrm e}^{-5 t} \]
Mathematica. Time used: 0.049 (sec). Leaf size: 37
ode=D[x[t],t]+5*x[t]==UnitStep[t-2]; 
ic={x[0]==1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \begin {array}{cc} \{ & \begin {array}{cc} e^{-5 t} & t\leq 2 \\ \frac {1}{5} e^{-5 t} \left (5-e^{10}+e^{5 t}\right ) & \text {True} \\ \end {array} \\ \end {array} \]
Sympy. Time used: 0.555 (sec). Leaf size: 32
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(5*x(t) - Heaviside(t - 2) + Derivative(x(t), t),0) 
ics = {x(0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = - \frac {e^{10 - 5 t} \theta \left (t - 2\right )}{5} + \frac {\theta \left (t - 2\right )}{5} + e^{- 5 t} \]