Integrate
cos(x) / (sin(x)sqrtof(sin^2(x)+1))dx
do a substitution. let $\displaystyle u^2 = \sin^2 x + 1$, then your integral becomes $\displaystyle \int \frac 1{u^2 - 1}~du$ .........do you see how to get to this?
(Note that the substitution is $\displaystyle u^{\color{red}2}$ and not just $\displaystyle u$)
now, i suppose you can finish up