\[ 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)-(a-1) a\right ) \] ✓ Mathematica : cpu = 0.758874 (sec), leaf count = 129
\[\left \{\left \{y(x)\to c_2 \left (e^{-a b x} \sin ^{-a-1}(x)+\frac {(2 a+1) \left (-1+e^{2 i x}\right ) e^{-a b x} \sin ^{a-2 (a+1)}(x) \, _2F_1\left (1,i a (b+i);i b a+a+2;e^{2 i x}\right ) (b \sin (x)+\cos (x))}{2 (a (b-i)-i)}\right )+c_1 e^{a b x} \sin ^a(x) (b \sin (x)+\cos (x))\right \}\right \}\] ✓ Maple : cpu = 1.82 (sec), leaf count = 179
\[ \left \{ y \left ( x \right ) ={{{\rm e}^{\int \!{\frac {1}{\sin \left ( 2\,x \right ) \left ( b\sin \left ( 2\,x \right ) +\cos \left ( 2\,x \right ) +1 \right ) } \left ( 2\, \left ( \left ( a+1 \right ) \cos \left ( 2\,x \right ) +a+1/2 \right ) b\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}} \left ( \int \!-2\,{{\rm e}^{-2\,\int \!{\frac {2\, \left ( \left ( a+1 \right ) \cos \left ( 2\,x \right ) +a+1/2 \right ) b\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 ( b\sin \left ( 2\,x \right ) +\cos \left ( 2\,x \right ) +1 \right ) }}\,{\rm d}x}}\sin \left ( 2\,x \right ) \,{\rm d}x{\it \_C2}+{\it \_C1} \right ) {\frac {1}{\sqrt {\sin \left ( 2\,x \right ) }}}} \right \} \]