67.4.16 problem Problem 3(b)

Internal problem ID [13981]
Book : APPLIED DIFFERENTIAL EQUATIONS The Primary Course by Vladimir A. Dobrushkin. CRC Press 2015
Section : Chapter 5.6 Laplace transform. Nonhomogeneous equations. Problems page 368
Problem number : Problem 3(b)
Date solved : Wednesday, March 05, 2025 at 10:24:36 PM
CAS classification : [[_linear, `class A`]]

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

Using Laplace method With initial conditions

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

Maple. Time used: 9.269 (sec). Leaf size: 38
ode:=diff(y(t),t)-2*y(t) = 4*t*(Heaviside(t)-Heaviside(t-2)); 
ic:=y(0) = 1; 
dsolve([ode,ic],y(t),method='laplace');
 
\[ y = -5 \operatorname {Heaviside}\left (t -2\right ) {\mathrm e}^{2 t -4}+2 t \operatorname {Heaviside}\left (t -2\right )-2 t +2 \,{\mathrm e}^{2 t}-1+\operatorname {Heaviside}\left (t -2\right ) \]
Mathematica. Time used: 0.491 (sec). Leaf size: 75
ode=D[y[t],t]-2*y[t]==4*t*(UnitStep[t]-UnitStep[t-2]); 
ic={y[0]==1}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to e^{2 t-4} \left (\theta (2-t) \left (e^2 \theta (t) \left (e^2 \int _1^t4 e^{-2 K[1]} K[1]dK[1]+2 e^2-3\right )-2 e^4+5\right )-e^4 \theta (t)+3 e^4-5\right ) \]
Sympy. Time used: 0.882 (sec). Leaf size: 63
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-4*t*(Heaviside(t) - Heaviside(t - 2)) - 2*y(t) + Derivative(y(t), t),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = - 2 t \theta \left (t\right ) + 2 t \theta \left (t - 2\right ) + e^{2 t} \theta \left (t\right ) + e^{2 t} - 5 e^{2 t - 4} \theta \left (t - 2\right ) - \theta \left (t\right ) + \theta \left (t - 2\right ) \]