61.4.29 problem Problem 4(e)

Internal problem ID [15354]
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 4(e)
Date solved : Thursday, October 02, 2025 at 10:12:00 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y&=\left \{\begin {array}{cc} 8 t & 0\le t <\frac {\pi }{2} \\ 8 \pi & \frac {\pi }{2}\le t \end {array}\right . \end{align*}

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&=0 \\ y^{\prime }\left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.296 (sec). Leaf size: 40
ode:=diff(diff(y(t),t),t)+4*y(t) = piecewise(0 <= t and t < 1/2*Pi,8*t,1/2*Pi <= t,8*Pi); 
ic:=[y(0) = 0, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = \left \{\begin {array}{cc} -\sin \left (2 t \right )+2 t & t <\frac {\pi }{2} \\ -2 \sin \left (2 t \right )+2 \pi \cos \left (t \right )^{2}+\pi & \frac {\pi }{2}\le t \end {array}\right . \]
Mathematica. Time used: 0.025 (sec). Leaf size: 48
ode=D[y[t],{t,2}]+4*y[t]==Piecewise[{{8*t,0<=t<Pi/2},{8*Pi,t>=Pi/2}}]; 
ic={y[0]==0,Derivative[1][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 0 \\ 2 t-\sin (2 t) & t>0\land 2 t\leq \pi \\ \pi \cos (2 t)-2 \sin (2 t)+2 \pi & \text {True} \\ \end {array} \\ \end {array} \end{align*}
Sympy. Time used: 0.297 (sec). Leaf size: 19
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((8*t, (t >= 0) & (t < pi/2)), (8*pi, t >= pi/2)) + 4*y(t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 0, Subs(Derivative(y(t), t), t, 0): 0} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \begin {cases} 2 t & \text {for}\: t \geq 0 \wedge t < \frac {\pi }{2} \\2 \pi & \text {for}\: t \geq \frac {\pi }{2} \\\text {NaN} & \text {otherwise} \end {cases} - \sin {\left (2 t \right )} \]