Hi everyone, For my calculus II class, I have an assignment where this question is giving me enormous trouble. I've been spending more than 5 hours on it and despite checking online solver, it just gets really confusing due to the sheer amount of substition and application of Weierstrass substitution. Is it possible to get better explanations for this?
Thank you1

First, use $$ \cos 2x=2\cos^2x-1\quad\text{and}\quad \sin 2x=2\sin x\cos x $$ to write your integrand as $$ \frac{4\cos^2 x-2+1}{\sin x(2\cos x\sin x-\sin x)} =\frac{(2\cos x-1)(2\cos x+1)}{\sin^2x(2\cos x-1)} =\frac{2\cos x-1}{\sin^2x}. $$ Then, it is straightforward to integrate, using (in the first one, let $u=\sin x$ if you are not sure about it) $$ \int \frac{\cos x}{\sin^2 x}\,dx=-\frac{1}{\sin x}\quad\text{and}\quad \int \frac{1}{\sin^2x}\,dx=-\cot x. $$