4.24.33 \(y''(x)+y(x)=a \cos (b x)\)

ODE
\[ y''(x)+y(x)=a \cos (b x) \] ODE Classification

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.091125 (sec), leaf count = 41

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

Maple
cpu = 0.185 (sec), leaf count = 27

\[ \left \{ y \left ( x \right ) =\sin \left ( x \right ) {\it \_C2}+\cos \left ( x \right ) {\it \_C1}-{\frac {a\cos \left ( bx \right ) }{{b}^{2}-1}} \right \} \] Mathematica raw input

DSolve[y[x] + y''[x] == a*Cos[b*x],y[x],x]

Mathematica raw output

{{y[x] -> ((-1 + b^2)*C[1]*Cos[x] - a*Cos[b*x] + (-1 + b^2)*C[2]*Sin[x])/(-1 + b
^2)}}

Maple raw input

dsolve(diff(diff(y(x),x),x)+y(x) = a*cos(b*x), y(x),'implicit')

Maple raw output

y(x) = sin(x)*_C2+cos(x)*_C1-a*cos(b*x)/(b^2-1)