67.21.7 problem 30.10 (b)

Internal problem ID [16913]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 30. Piecewise-defined functions and periodic functions. Additional Exercises. page 553
Problem number : 30.10 (b)
Date solved : Thursday, October 02, 2025 at 01:40:18 PM
CAS classification : [[_2nd_order, _quadrature]]

\begin{align*} y^{\prime \prime }&=\left \{\begin {array}{cc} 0 & t <1 \\ 1 & 1<t <3 \\ 0 & 3<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.124 (sec). Leaf size: 27
ode:=diff(diff(y(t),t),t) = piecewise(t < 1,0,1 < t and t < 3,1,3 < t,0); 
ic:=[y(0) = 0, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(t),method='laplace');
 
\[ y = \left \{\begin {array}{cc} 0 & t <1 \\ \frac {\left (t -1\right )^{2}}{2} & t <3 \\ -4+2 t & 3\le t \end {array}\right . \]
Mathematica. Time used: 0.005 (sec). Leaf size: 33
ode=D[y[t],{t,2}]==Piecewise[{ {0,t<1},{1,1<t<3},{0,t>3}}]; 
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 1 \\ \frac {1}{2} (t-1)^2 & 1<t\leq 3 \\ 2 (t-2) & \text {True} \\ \end {array} \\ \end {array} \end{align*}
Sympy. Time used: 0.179 (sec). Leaf size: 10
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-Piecewise((0, t < 1), (1, (t > 1) & (t < 3)), (0, t > 3)) + 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} 0 & \text {for}\: t < 1 \\\frac {t^{2}}{2} & \text {for}\: t > 1 \wedge t < 3 \\0 & \text {for}\: t > 3 \\\text {NaN} & \text {otherwise} \end {cases} \]