15.2 problem 2

Internal problem ID [2235]

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.
ODE order: 2.
ODE degree: 1.

CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]

\[ \boxed {y^{\prime \prime }+y=\cos \left (x \right ) x^{2}} \]

Solution by Maple

Time used: 0.0 (sec). Leaf size: 33

dsolve(diff(y(x),x$2)+y(x)=x^2*cos(x),y(x), singsol=all)
 

\[ y = \sin \left (x \right ) c_{2} +\cos \left (x \right ) c_{1} +\frac {\left (2 x^{3}-3 x \right ) \sin \left (x \right )}{12}+\frac {\cos \left (x \right ) x^{2}}{4} \]

Solution by Mathematica

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

DSolve[y''[x]+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) \]