ODE
\[ y''(x)+y(x)=8 \cos (x) \cos (2 x) \] ODE Classification
[[_2nd_order, _linear, _nonhomogeneous]]
Book solution method
TO DO
Mathematica ✓
cpu = 0.167055 (sec), leaf count = 30
\[\left \{\left \{y(x)\to -\frac {1}{2} \cos (3 x)+(1+c_1) \cos (x)+(2 x+c_2) \sin (x)\right \}\right \}\]
Maple ✓
cpu = 0.345 (sec), leaf count = 24
\[[y \left (x \right ) = \sin \left (x \right ) \textit {\_C2} +\textit {\_C1} \cos \left (x \right )+2 \sin \left (x \right ) \left (\cos \left (x \right ) \sin \left (x \right )+x \right )]\] Mathematica raw input
DSolve[y[x] + y''[x] == 8*Cos[x]*Cos[2*x],y[x],x]
Mathematica raw output
{{y[x] -> (1 + C[1])*Cos[x] - Cos[3*x]/2 + (2*x + C[2])*Sin[x]}}
Maple raw input
dsolve(diff(diff(y(x),x),x)+y(x) = 8*cos(x)*cos(2*x), y(x))
Maple raw output
[y(x) = sin(x)*_C2+_C1*cos(x)+2*sin(x)*(cos(x)*sin(x)+x)]