4.25.4 \(a^2 y(x)+y''(x)=\cos (b x)\)

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

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.291044 (sec), leaf count = 55

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

Maple
cpu = 0.511 (sec), leaf count = 33

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

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

Mathematica raw output

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

Maple raw input

dsolve(diff(diff(y(x),x),x)+a^2*y(x) = cos(b*x), y(x))

Maple raw output

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