76.17.23 problem 34 (b)

Internal problem ID [17709]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 4. Second order linear equations. Section 4.7 (Variation of parameters). Problems at page 280
Problem number : 34 (b)
Date solved : Tuesday, January 28, 2025 at 11:01:40 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=g \left (t \right ) \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=y_{0}\\ y^{\prime }\left (0\right )&=y_{1} \end{align*}

Solution by Maple

Time used: 0.354 (sec). Leaf size: 42

dsolve([diff(y(t),t$2)+y(t)=g(t),y(0) = y__0, D(y)(0) = y__1],y(t), singsol=all)
 
\[ y = y_{1} \sin \left (t \right )+\cos \left (t \right ) y_{0} +\left (\int _{0}^{t}\cos \left (\textit {\_z1} \right ) g \left (\textit {\_z1} \right )d \textit {\_z1} \right ) \sin \left (t \right )-\left (\int _{0}^{t}\sin \left (\textit {\_z1} \right ) g \left (\textit {\_z1} \right )d \textit {\_z1} \right ) \cos \left (t \right ) \]

Solution by Mathematica

Time used: 0.045 (sec). Leaf size: 86

DSolve[{D[y[t],{t,2}]+y[t]==g[t],{y[0]==y0,Derivative[1][y][0] == y1}},y[t],t,IncludeSingularSolutions -> True]
 
\[ y(t)\to -\cos (t) \int _1^0-g(K[1]) \sin (K[1])dK[1]+\cos (t) \int _1^t-g(K[1]) \sin (K[1])dK[1]-\sin (t) \int _1^0\cos (K[2]) g(K[2])dK[2]+\sin (t) \int _1^t\cos (K[2]) g(K[2])dK[2]+\text {y0} \cos (t)+\text {y1} \sin (t) \]