<s>[INST] Evaluate $\int\frac{\cos^2 x}{1-\sin x }dx$ $\int\frac{\cos^2 x}{1-\sin x} dx $ can someone explain me how to solve this one and please show your complete solution? So am I supposed to make the numerator $1+sinx$? but I think that doesn't help. Should I do long division?
 [/INST] We know that $\displaystyle \cos^2 x = 1 - \sin^2 x = (1-\sin x)(1+ \sin x)$
Hence,
$$
\require{cancel}
\begin{align}
\int\frac{\cos^2x}{1-\sin x}\mathrm dx &= \int \frac{\cancel{(1-\sin x)}(1+\sin x)}{\cancel{1- \sin x}}\mathrm dx\\
&= \int \mathrm dx + \int \sin x\\
&= x - \cos x + \color{gray}{\mathcal C} 
\end{align}$$

Aliter:: The same method in another approach:
$$\require{cancel} \frac{\cos^2 x}{1 - \sin x}\cdot \frac{1 + \sin x}{1 + \sin x} = \frac{\cancel{\cos ^2 x}\cdot (1 + \sin x)}{\cancel{\cos^2 x}} = 1 + \sin x$$
</s>