58.1.44 problem 44

Internal problem ID [9115]
Book : Second order enumerated odes
Section : section 1
Problem number : 44
Date solved : Monday, January 27, 2025 at 05:42:25 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.002 (sec). Leaf size: 18

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

Solution by Mathematica

Time used: 0.019 (sec). Leaf size: 28

DSolve[D[y[x],{x,2}]+y[x]==Cos[x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {1}{2} (x \sin (x)+\cos (x)+2 c_1 \cos (x)+2 c_2 \sin (x)) \]