15.14.5 problem 5

Internal problem ID [3177]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 23, page 106
Problem number : 5
Date solved : Monday, January 27, 2025 at 07:25:07 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+2 y&=\sin \left (x \right ) \end{align*}

Solution by Maple

Time used: 0.004 (sec). Leaf size: 23

dsolve(diff(y(x),x$2)+2*y(x)=sin(x),y(x), singsol=all)
 
\[ y = c_2 \sin \left (\sqrt {2}\, x \right )+\cos \left (\sqrt {2}\, x \right ) c_{1} +\sin \left (x \right ) \]

Solution by Mathematica

Time used: 0.201 (sec). Leaf size: 30

DSolve[D[y[x],{x,2}]+2*y[x]==Sin[x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \sin (x)+c_1 \cos \left (\sqrt {2} x\right )+c_2 \sin \left (\sqrt {2} x\right ) \]