15.15.3 problem 3

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

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

Solution by Maple

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

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

Solution by Mathematica

Time used: 0.022 (sec). Leaf size: 35

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