52.7.5 problem 13

Internal problem ID [8360]
Book : DIFFERENTIAL EQUATIONS with Boundary Value Problems. DENNIS G. ZILL, WARREN S. WRIGHT, MICHAEL R. CULLEN. Brooks/Cole. Boston, MA. 2013. 8th edition.
Section : CHAPTER 7 THE LAPLACE TRANSFORM. 7.4.1 DERIVATIVES OF A TRANSFORM. Page 309
Problem number : 13
Date solved : Sunday, March 30, 2025 at 12:52:52 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+16 y&=\left \{\begin {array}{cc} \cos \left (4 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 )&=0\\ y^{\prime }\left (0\right )&=1 \end{align*}

Maple. Time used: 0.317 (sec). Leaf size: 21
ode:=diff(diff(y(t),t),t)+16*y(t) = piecewise(0 <= t and t < Pi,cos(4*t),Pi <= t,0); 
ic:=y(0) = 0, D(y)(0) = 1; 
dsolve([ode,ic],y(t),method='laplace');
 
\[ y = \frac {\sin \left (4 t \right ) \left (2+\left (\left \{\begin {array}{cc} t & t <\pi \\ \pi & \pi \le t \end {array}\right .\right )\right )}{8} \]
Mathematica. Time used: 0.092 (sec). Leaf size: 60
ode=D[y[t],{t,2}]+16*y[t]==Piecewise[{{Cos[4*t],0<=t<Pi},{0,t>=Pi}}]; 
ic={y[0]==1,Derivative[1][y][0] ==1}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} \cos (4 t)+\frac {1}{4} \sin (4 t) & t\leq 0 \\ \cos (4 t)+\frac {1}{8} (2+\pi ) \sin (4 t) & t>\pi \\ \cos (4 t)+\frac {1}{8} (t+2) \sin (4 t) & \text {True} \\ \end {array} \\ \end {array} \]
Sympy. Time used: 0.439 (sec). Leaf size: 26
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((cos(4*t), (t >= 0) & (t < pi)), (0, t >= pi)) + 16*y(t) + Derivative(y(t), (t, 2)),0) 
ics = {y(0): 1, Subs(Derivative(y(t), t), t, 0): 1} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \begin {cases} \frac {t \sin {\left (4 t \right )}}{8} & \text {for}\: t \geq 0 \wedge t < \pi \\0 & \text {for}\: t \geq \pi \\\text {NaN} & \text {otherwise} \end {cases} + \frac {\sin {\left (4 t \right )}}{4} + \cos {\left (4 t \right )} \]