90.27.6 problem 6

Internal problem ID [25416]
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 : 6
Date solved : Friday, October 03, 2025 at 12:01:19 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} 3 y+y^{\prime }&=\left \{\begin {array}{cc} 10 \sin \left (t \right ) & 0\le t <\pi \\ 0 & \pi \le t \end {array}\right . \end{align*}

Using Laplace method With initial conditions

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