4.26.23 \(2 a y'(x)+b^2 y(x)+y''(x)=c \sin (k x)\)

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

\[\left \{\left \{y(x)\to c_1 e^{-\left (x \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.279 (sec), leaf count = 101

\[\left [y \left (x \right ) = {\mathrm e}^{\left (-a +\sqrt {a^{2}-b^{2}}\right ) x} \textit {\_C2} +{\mathrm e}^{\left (-a -\sqrt {a^{2}-b^{2}}\right ) x} \textit {\_C1} -\frac {c \left (2 \cos \left (k x \right ) a k -\sin \left (k x \right ) b^{2}+\sin \left (k x \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))

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)]