##### 4.24.37 $$y''(x)+y(x)=\sin (a x) \sin (b x)$$

ODE
$y''(x)+y(x)=\sin (a x) \sin (b x)$ ODE Classiﬁcation

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.569148 (sec), leaf count = 159

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

Maple
cpu = 0.626 (sec), leaf count = 82

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

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

Mathematica raw output

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

Maple raw input

dsolve(diff(diff(y(x),x),x)+y(x) = sin(a*x)*sin(b*x), y(x))

Maple raw output

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