78.13.13 problem 3 (a)

Internal problem ID [18335]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 18. The Method of Undetermined Coefficients. Problems at page 132
Problem number : 3 (a)
Date solved : Tuesday, January 28, 2025 at 11:47:04 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y&=4 \cos \left (2 x \right )+6 \cos \left (x \right )+8 x^{2}-4 x \end{align*}

Solution by Maple

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

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

Solution by Mathematica

Time used: 0.364 (sec). Leaf size: 43

DSolve[D[y[x],{x,2}] +4*y[x]==4*Cos[2*x]+6*Cos[x]+8*x^2-4*x,y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to 2 x^2-x+x \sin (2 x)+2 \cos (x)+\left (\frac {1}{2}+c_1\right ) \cos (2 x)+c_2 \sin (2 x)-1 \]