82.33.4 problem Ex. 4

Internal problem ID [18897]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. Examples on chapter VI, page 80
Problem number : Ex. 4
Date solved : Tuesday, January 28, 2025 at 12:33:51 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y&=\sin \left (3 x \right )+{\mathrm e}^{x}+x^{2} \end{align*}

Solution by Maple

Time used: 0.004 (sec). Leaf size: 39

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

Solution by Mathematica

Time used: 0.411 (sec). Leaf size: 45

DSolve[D[y[x],{x,2}]+4*y[x]==Sin[3*x]+Exp[x]+x^2,y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {x^2}{4}+\frac {e^x}{5}-\frac {1}{5} \sin (3 x)+c_1 \cos (2 x)+c_2 \sin (2 x)-\frac {1}{8} \]