4.24.34 \(y''(x)+y(x)=8 \cos (x) \cos (2 x)\)

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.0344939 (sec), leaf count = 30

\[\left \{\left \{y(x)\to \left (c_2+2 x\right ) \sin (x)+\left (c_1+1\right ) \cos (x)-\frac {1}{2} \cos (3 x)\right \}\right \}\]

Maple
cpu = 0.092 (sec), leaf count = 25

\[ \left \{ y \left ( x \right ) =2\, \left ( \sin \left ( x \right ) \right ) ^{2}\cos \left ( x \right ) + \left ( 2\,x+{\it \_C2} \right ) \sin \left ( x \right ) +\cos \left ( x \right ) {\it \_C1} \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),'implicit')

Maple raw output

y(x) = 2*sin(x)^2*cos(x)+(2*x+_C2)*sin(x)+cos(x)*_C1