Internal problem ID [14909]
Book: INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton.
Fourth edition 2014. ElScAe. 2014
Section: Chapter 5. Applications of Higher Order Equations. Exercises 5.3, page 249
Problem number: 15.
ODE order: 2.
ODE degree: 1.
CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]
\[ \boxed {x^{\prime \prime }+x=\left \{\begin {array}{cc} 1 & 0\le t <\pi \\ 0 & \pi \le t \end {array}\right .} \] With initial conditions \begin {align*} [x \left (0\right ) = 0, x^{\prime }\left (0\right ) = 0] \end {align*}
✓ Solution by Maple
Time used: 0.578 (sec). Leaf size: 25
dsolve([diff(x(t),t$2)+x(t)=piecewise(0<=t and t<Pi,1,t>=Pi,0),x(0) = 0, D(x)(0) = 0],x(t), singsol=all)
\[ x \left (t \right ) = \left \{\begin {array}{cc} 0 & t <0 \\ -\cos \left (t \right )+1 & t <\pi \\ -2 \cos \left (t \right ) & \pi \le t \end {array}\right . \]
✓ Solution by Mathematica
Time used: 0.03 (sec). Leaf size: 29
DSolve[{x''[t]+x[t]==Piecewise[{{1,0<=t<Pi},{0,t>=Pi}}],{x[0]==0,x'[0]==0}},x[t],t,IncludeSingularSolutions -> True]
\[ x(t)\to \begin {array}{cc} \{ & \begin {array}{cc} 0 & t\leq 0 \\ 1-\cos (t) & 0<t\leq \pi \\ -2 \cos (t) & \text {True} \\ \end {array} \\ \end {array} \]