How to Find the Recurrence Formula for $\int \frac{dx} {(1+\sin x)^n}$? 
$$\int \frac{dx} {(1+\sin x)^n}$$

I know that I should use the following step:

$$\int\frac{\sin^2(x)\, dx}{(1+\sin x)^n} +\int\frac{\cos^2(x)\, dx} {(1+\sin x)^n} $$

but here I get stuck. I do not know how shall I proceed.

A more direct method exists without substitution, which I will discuss here.
Observe that:
$\displaystyle \large 2I_n - I_{n-1} = \int \frac{\cos^2{x}}{(1+\sin{x})^{n+1}} \text{d}x = \int \frac{\text{d}(1+\sin{x})}{(1+\sin{x})^{n+1}} \cos{x}$
Integrate by parts directly to obtain:
$\displaystyle \large 2I_n - I_{n-1} = -\frac{\cos{x}}{n(1+\sin{x})^n} - \frac{1}{n} \int \frac{\sin{x}}{(1+\sin{x})^n} \text{d}x$
$\displaystyle \large 2I_n - I_{n-1} = -\frac{\cos{x}}{n(1+\sin{x})^n} - \frac{I_{n-1}-I_n}{n}$
Rearrange to obtain:
$\displaystyle \large (2n-1)I_n = -\frac{\cos{x}}{(1+\sin{x})^n} + (n-1)I_{n-1}$
And the rest is trivial.
