62.27.3 problem Ex 3

Internal problem ID [12941]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter VII, Linear differential equations with constant coefficients. Article 50. Method of undetermined coefficients. Page 107
Problem number : Ex 3
Date solved : Tuesday, January 28, 2025 at 04:44:40 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=2 \,{\mathrm e}^{x}+x^{3}-x \end{align*}

Solution by Maple

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

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

Solution by Mathematica

Time used: 0.127 (sec). Leaf size: 75

DSolve[D[y[x],{x,2}]+y[x]==2*Exp[x]+x^3-x,y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \cos (x) \int _1^x-\left (\left (K[1]^3-K[1]+2 e^{K[1]}\right ) \sin (K[1])\right )dK[1]+\sin (x) \int _1^x\cos (K[2]) \left (K[2]^3-K[2]+2 e^{K[2]}\right )dK[2]+c_1 \cos (x)+c_2 \sin (x) \]