ODE
\[ 2 a y'(x)+b^2 y(x)+y''(x)=c \sin (k x) \] ODE Classification
[[_2nd_order, _linear, _nonhomogeneous]]
Book solution method
TO DO
Mathematica ✓
cpu = 0.373616 (sec), leaf count = 103
\[\left \{\left \{y(x)\to c_1 e^{x \left (-\left (\sqrt {a^2-b^2}+a\right )\right )}+c_2 e^{x \left (\sqrt {a^2-b^2}-a\right )}+\frac {c \left (\left (b^2-k^2\right ) \sin (k x)-2 a k \cos (k x)\right )}{4 a^2 k^2+b^4-2 b^2 k^2+k^4}\right \}\right \}\]
Maple ✓
cpu = 0.082 (sec), leaf count = 98
\[ \left \{ y \left ( x \right ) ={{\rm e}^{ \left ( -a+\sqrt {{a}^{2}-{b}^{2}} \right ) x}}{\it \_C2}+{{\rm e}^{- \left ( a+\sqrt {{a}^{2}-{b}^{2}} \right ) x}}{\it \_C1}-{\frac {c \left ( 2\,\cos \left ( kx \right ) ak-\sin \left ( kx \right ) {b}^{2}+\sin \left ( kx \right ) {k}^{2} \right ) }{4\,{a}^{2}{k}^{2}+{b}^{4}-2\,{b}^{2}{k}^{2}+{k}^{4}}} \right \} \] Mathematica raw input
DSolve[b^2*y[x] + 2*a*y'[x] + y''[x] == c*Sin[k*x],y[x],x]
Mathematica raw output
{{y[x] -> C[1]/E^((a + Sqrt[a^2 - b^2])*x) + E^((-a + Sqrt[a^2 - b^2])*x)*C[2] +
(c*(-2*a*k*Cos[k*x] + (b^2 - k^2)*Sin[k*x]))/(b^4 + 4*a^2*k^2 - 2*b^2*k^2 + k^4
)}}
Maple raw input
dsolve(diff(diff(y(x),x),x)+2*a*diff(y(x),x)+b^2*y(x) = c*sin(k*x), y(x),'implicit')
Maple raw output
y(x) = exp((-a+(a^2-b^2)^(1/2))*x)*_C2+exp(-(a+(a^2-b^2)^(1/2))*x)*_C1-c*(2*cos(
k*x)*a*k-sin(k*x)*b^2+sin(k*x)*k^2)/(4*a^2*k^2+b^4-2*b^2*k^2+k^4)