ODE
\[ y''(x)+y(x)=a \cos (b x) \] ODE Classification
[[_2nd_order, _linear, _nonhomogeneous]]
Book solution method
TO DO
Mathematica ✓
cpu = 0.235521 (sec), leaf count = 30
\[\left \{\left \{y(x)\to -\frac {a \cos (b x)}{b^2-1}+c_1 \cos (x)+c_2 \sin (x)\right \}\right \}\]
Maple ✓
cpu = 0.374 (sec), leaf count = 27
\[\left [y \left (x \right ) = \sin \left (x \right ) \textit {\_C2} +\textit {\_C1} \cos \left (x \right )-\frac {a \cos \left (b x \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] -> C[1]*Cos[x] - (a*Cos[b*x])/(-1 + b^2) + C[2]*Sin[x]}}
Maple raw input
dsolve(diff(diff(y(x),x),x)+y(x) = a*cos(b*x), y(x))
Maple raw output
[y(x) = sin(x)*_C2+_C1*cos(x)-a*cos(b*x)/(b^2-1)]