15.15.2 problem 2

Internal problem ID [3206]
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 : 2
Date solved : Monday, January 27, 2025 at 07:26:02 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: 32

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

Solution by Mathematica

Time used: 0.067 (sec). Leaf size: 41

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