So, I need to compute a integral for $$ \frac{1}{5-4 \sin(x) + 3 \cos(x)}. $$ On integral calculator the following transformation is made: $$ -\frac{\sec^2\left(\frac{x}{2}\right)}{2\left(\tan\left(\frac{x}{2}\right)-2\right)^2}. $$
I have no idea how the first expression is transformed into the second one. Could someone help me out?
Hint: Use Tangent half-angle substitution $$\sin x=\dfrac{2t}{1+t^2}~~~,~~~\cos x=\dfrac{1-t^2}{1+t^2}~~~,~~~dx=\dfrac{2}{1+t^2}$$ and then $t-2=u$.