11.10 problem 2(d)

Internal problem ID [5573]

Book: Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section: Chapter 2. Second-Order Linear Equations. Section 2.3. THE METHOD OF VARIATION OF PARAMETERS. Page 71
Problem number: 2(d).
ODE order: 2.
ODE degree: 1.

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

Solve \begin {gather*} \boxed {y^{\prime \prime }+y-x \cos \relax (x )=0} \end {gather*}

Solution by Maple

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

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

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

Solution by Mathematica

Time used: 0.029 (sec). Leaf size: 34

DSolve[y''[x]+y[x]==x*Cos[x],y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to \frac {1}{8} \left (\left (2 x^2-1+8 c_2\right ) \sin (x)+2 (x+4 c_1) \cos (x)\right ) \\ \end{align*}