40.7.10 problem 27

Internal problem ID [8657]
Book : ADVANCED ENGINEERING MATHEMATICS. ERWIN KREYSZIG, HERBERT KREYSZIG, EDWARD J. NORMINTON. 10th edition. John Wiley USA. 2011
Section : Chapter 6. Laplace Transforms. Problem set 6.3, page 224
Problem number : 27
Date solved : Tuesday, September 30, 2025 at 05:40:19 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Using Laplace method With initial conditions

\begin{align*} y \left (1\right )&=1+\cos \left (2\right ) \\ y^{\prime }\left (1\right )&=4-2 \sin \left (2\right ) \\ \end{align*}
Maple. Time used: 0.524 (sec). Leaf size: 40
ode:=diff(diff(y(t),t),t)+4*y(t) = piecewise(0 < t and t < 5,8*t^2,5 < t,0); 
ic:=[y(1) = 1+cos(2), D(y)(1) = 4-2*sin(2)]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = \cos \left (2 t \right )+\left (\left \{\begin {array}{cc} 2 t^{2}-1 & t <5 \\ 49 \cos \left (2 t -10\right )+10 \sin \left (2 t -10\right ) & 5\le t \end {array}\right .\right ) \]
Mathematica. Time used: 0.026 (sec). Leaf size: 51
ode=D[y[t],{t,2}]+4*y[t]==Piecewise[{{8*t^2,0<t<5},{0,t>5}}]; 
ic={y[1]==1+Cos[2],Derivative[1][y][1]==4-2*Sin[2]}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to \begin {array}{cc} \{ & \begin {array}{cc} 2 t^2+\cos (2 t)-1 & 0<t\leq 5 \\ 49 \cos (2 (t-5))+\cos (2 t)-10 \sin (10-2 t) & t>5 \\ \end {array} \\ \end {array} \end{align*}
Sympy. Time used: 0.338 (sec). Leaf size: 17
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((8*t**2, (t > 0) & (t < 5)), (0, t > 5)) + 4*y(t) + Derivative(y(t), (t, 2)),0) 
ics = {y(1): cos(2) + 1, Subs(Derivative(y(t), t), t, 1): 4 - 2*sin(2)} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = \begin {cases} 2 t^{2} - 1 & \text {for}\: t > 0 \wedge t < 5 \\0 & \text {for}\: t > 5 \\\text {NaN} & \text {otherwise} \end {cases} + \cos {\left (2 t \right )} \]