Question:
Find the value of the following expression:
$$\int \frac{\cos^2x}{1+\sin x}\ dx$$
My Working:
Failed Method 1:
Basically, I first tried to use $u$-substitution with $u=1+\sin x$, and this would result in
\begin{align} \frac{du}{dx}&=\cos x\\ du&=\cos x\cdot dx \end{align}
This would not cancel out the other $\cos x$.
Failed Method 2:
I also tried using the formula $$\cos^2x=\frac{1+\cos2x}{2},$$ but that would result in the integral being equivalent to
\begin{align} & \quad\int\frac{\frac{1+\cos 2x}{2}}{1+\sin x}\ dx\\ &=\int\frac{1+\cos2x}{2+2\sin x}\ dx \end{align}
Nothing would cancel out here either.
WolframAlpha's Answer Which Looks Ridiculous:
I've also tried using WolframAlpha, but the "answer", shown below, looks terrifying, and maybe not the right answer (at least, not the simplified right answer). (By the way, I don't have WolframAlpha Pro, so I cannot access the step-by-step solution)
$$-\frac{\left[2 \sqrt{1 - \sin x} \sin^{-1}\left(\frac{\sqrt{1 - \sin x}}{\sqrt{2}}\right) + (\sin x - 1) \sqrt{\sin x + 1}\right] \cos^3x}{(\sin x - 1)^2 (\sin x + 1)^{3/2}} + c$$