14.11 problem Problem 37

Internal problem ID [2877]

Book: Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section: Chapter 10, The Laplace Transform and Some Elementary Applications. Exercises for 10.7. page 704
Problem number: Problem 37.
ODE order: 2.
ODE degree: 1.

CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]

\[ \boxed {y^{\prime \prime }+y=t -\operatorname {Heaviside}\left (t -1\right ) \left (t -1\right )} \] With initial conditions \begin {align*} [y \left (0\right ) = 2, y^{\prime }\left (0\right ) = 1] \end {align*}

Solution by Maple

Time used: 2.156 (sec). Leaf size: 25

dsolve([diff(y(t),t$2)+y(t)=t-Heaviside(t-1)*(t-1),y(0) = 2, D(y)(0) = 1],y(t), singsol=all)
 

\[ y \left (t \right ) = \left (-t +\sin \left (t -1\right )+1\right ) \operatorname {Heaviside}\left (t -1\right )+t +2 \cos \left (t \right ) \]

Solution by Mathematica

Time used: 0.025 (sec). Leaf size: 31

DSolve[{y''[t]+y[t]==t-UnitStep[t-1]*(t-1),{y[0]==2,y'[0]==1}},y[t],t,IncludeSingularSolutions -> True]
 

\[ y(t)\to \begin {array}{cc} \{ & \begin {array}{cc} t+2 \cos (t) & t\leq 1 \\ 2 \cos (t)-\sin (1-t)+1 & \text {True} \\ \end {array} \\ \end {array} \]