\[ \boxed { {\frac {{\rm d}^{2}}{{\rm d}{x}^{2}}}y \left ( x \right ) =-{\frac { \left ( - \left ( {a}^{2}{b}^{2}- \left ( a+1 \right ) ^{2} \right ) \left ( \sin \left ( x \right ) \right ) ^{2}-a \left ( a+1 \right ) b\sin \left ( 2\,x \right ) -a \left ( a-1 \right ) \right ) y \left ( x \right ) }{ \left ( \sin \left ( x \right ) \right ) ^{2}}}=0} \]
Mathematica: cpu = 200.592472 (sec), leaf count = 57 \[ \text {DSolve}\left [y''(x)=y(x) \left (-\csc ^2(x)\right ) \left (-\left (a^2 b^2-(a+1)^2\right ) \sin ^2(x)-a (a+1) b \sin (2 x)+(1-a) a\right ),y(x),x\right ] \]
Maple: cpu = 1.107 (sec), leaf count = 262 \[ \left \{ y \left ( x \right ) ={{\it \_C1}{{\rm e}^{\int \!{\frac {1}{ \sin \left ( 2\,x \right ) \left ( \sin \left ( 2\,x \right ) b+\cos \left ( 2\,x \right ) +1 \right ) } \left ( 2\,b \left ( \left ( a+1 \right ) \cos \left ( 2\,x \right ) +a+1/2 \right ) \sin \left ( 2\,x \right ) - \left ( \cos \left ( 2\,x \right ) +1 \right ) \left ( \left ( a{b}^{2}-a-2 \right ) \cos \left ( 2\,x \right ) -a{b}^{2}-a+1 \right ) \right ) }\,{\rm d}x}}{\frac {1}{\sqrt {\sin \left ( 2\,x \right ) }}}}+ {{\it \_C2}{{\rm e}^{\int \!{\frac {1}{\sin \left ( 2\,x \right ) \left ( \sin \left ( 2\,x \right ) b+\cos \left ( 2\,x \right ) +1 \right ) } \left ( 2\,b \left ( \left ( a+1 \right ) \cos \left ( 2\,x \right ) +a+1/2 \right ) \sin \left ( 2\,x \right ) - \left ( \cos \left ( 2\,x \right ) +1 \right ) \left ( \left ( a{b}^{2}-a-2 \right ) \cos \left ( 2\,x \right ) -a{b}^{2}-a+1 \right ) \right ) }\,{\rm d}x}}\int \!-2\,{{\rm e}^{-2\,\int \!{\frac {2\,b \left ( \left ( a+1 \right ) \cos \left ( 2\,x \right ) +a+1/2 \right ) \sin \left ( 2\,x \right ) - \left ( \cos \left ( 2\,x \right ) +1 \right ) \left ( \left ( a{b}^{2}-a -2 \right ) \cos \left ( 2\,x \right ) -a{b}^{2}-a+1 \right ) }{\sin \left ( 2\,x \right ) \left ( \sin \left ( 2\,x \right ) b+\cos \left ( 2 \,x \right ) +1 \right ) }}\,{\rm d}x}}\sin \left ( 2\,x \right ) \,{\rm d}x{\frac {1}{\sqrt {\sin \left ( 2\,x \right ) }}}} \right \} \]