I have $$\int\frac{\cos x}{6+2\sin x-\cos^2x}dx .$$
Online solvers have problems with it so what I need are some general guidelines on how to proceed with such as to whether do I need to apply some goniometric identity, or do I need to split it to partial fractions or such. Thanks very much for any help.
$$\int \frac{\cos x}{6+2\sin x-\cos^2 x}\, dx=\int \frac{1}{6+2\sin x-\left(1-\sin^2 x\right)}\, d(\sin x)$$
Let $u=\sin x$.
$$=\int \frac{1}{u^2+2u+5}\, du=\int \frac{1}{(u+1)^2+4}\, d(u+1)$$
Let $2t=u+1$. Then $d(u+1)=2\, dt$.
$$=\frac{1}{2}\int \frac{1}{t^2+1}\, dt=\frac{1}{2}\arctan t+C=\frac{1}{2}\arctan \frac{\sin x+1}{2}+C$$