62.29.11 problem Ex 13

Internal problem ID [12962]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter VII, Linear differential equations with constant coefficients. Article 52. Summary. Page 117
Problem number : Ex 13
Date solved : Tuesday, January 28, 2025 at 04:45:29 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.003 (sec). Leaf size: 26

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

Solution by Mathematica

Time used: 0.069 (sec). Leaf size: 54

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