76.17.12 problem 21

Internal problem ID [17698]
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 : 21
Date solved : Tuesday, January 28, 2025 at 11:01:17 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.005 (sec). Leaf size: 47

dsolve(diff(y(t),t$2)+4*y(t)=g(t),y(t), singsol=all)
 
\[ y = \sin \left (2 t \right ) c_{2} +\cos \left (2 t \right ) c_{1} +\frac {\left (\int \cos \left (2 t \right ) g \left (t \right )d t \right ) \sin \left (2 t \right )}{2}-\frac {\left (\int \sin \left (2 t \right ) g \left (t \right )d t \right ) \cos \left (2 t \right )}{2} \]

Solution by Mathematica

Time used: 0.055 (sec). Leaf size: 67

DSolve[D[y[t],{t,2}]+4*y[t]==g[t],y[t],t,IncludeSingularSolutions -> True]
 
\[ y(t)\to \cos (2 t) \int _1^t-\cos (K[1]) g(K[1]) \sin (K[1])dK[1]+\sin (2 t) \int _1^t\frac {1}{2} \cos (2 K[2]) g(K[2])dK[2]+c_1 \cos (2 t)+c_2 \sin (2 t) \]