7.11.17 problem 17

Internal problem ID [338]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 2. Linear Equations of Higher Order. Section 2.5 (Nonhomogeneous equations and undetermined coefficients). Problems at page 161
Problem number : 17
Date solved : Wednesday, February 05, 2025 at 03:21:26 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\sin \left (x \right )+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)=sin(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 (x -4 c_1 \right )}{4} \]

Solution by Mathematica

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

DSolve[D[y[x],{x,2}]+y[x]==Sin[x]+x*Cos[x],y[x],x,IncludeSingularSolutions -> True]
 
\[ 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 ) \]