90.27.1 problem 1

Internal problem ID [25411]
Book : Ordinary Differential Equations. By William Adkins and Mark G Davidson. Springer. NY. 2010. ISBN 978-1-4614-3617-1
Section : Chapter 6. Discontinuous Functions and the Laplace Transform. Exercises at page 425
Problem number : 1
Date solved : Friday, October 03, 2025 at 12:01:15 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }+2 y&=\left \{\begin {array}{cc} 0 & 0\le t <1 \\ -3 & 1\le t \end {array}\right . \end{align*}

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.043 (sec). Leaf size: 22
ode:=diff(y(t),t)+2*y(t) = piecewise(t < 1 and 0 <= t,0,1 <= t,-3); 
ic:=[y(0) = 0]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = \left \{\begin {array}{cc} 0 & t <1 \\ -\frac {3}{2}+\frac {3 \,{\mathrm e}^{-2 t +2}}{2} & 1\le t \end {array}\right . \]
Mathematica. Time used: 0.026 (sec). Leaf size: 25
ode=D[y[t],{t,1}]+2*y[t]==Piecewise[{ {0, 0<=t<1}, {-3,t>=1}}]; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 1 \\ \frac {3}{2} \left (-1+e^{2-2 t}\right ) & \text {True} \\ \end {array} \\ \end {array} \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((0, (t >= 0) & (t < 1)), (-3, (t >= 1) & (t < oo))) + 2*y(t) + Derivative(y(t), t),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(t),ics=ics)