14.11 problem Problem 37

Internal problem ID [2368]

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]]

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

Solution by Maple

Time used: 0.031 (sec). Leaf size: 24

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 \relax (t ) = 2 \cos \relax (t )+\left (-t +\sin \left (t -1\right )+1\right ) \theta \left (t -1\right )+t \]

Solution by Mathematica

Time used: 0.008 (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]
 

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