Find $\int^{\pi/2}_0 \frac{\sin^{n-2}(x)}{(1+\cos x)^n}\mathrm dx$

Note that the $\csc^2(x)$ term can be expressed in terms of $\tan\left(\frac x2\right)$ aswell. To be precise we got that

\begin{align*} \csc^2(x)=\left(\frac1{\sin(x)}\right)^2=\left(\frac1{2\sin\left(\frac x2\right)\cos\left(\frac x2\right)}\right)^2=\left(\frac{\frac1{\cos^2\left(\frac x2\right)}}{2\frac{\sin\left(\frac x2\right)}{\cos\left(\frac x2\right)}}\right)^2 =\left(\frac{1+\tan^2\left(\frac x2\right)}{2\tan\left(\frac x2\right)}\right)^2 \end{align*}

Using this and further noticing that $\frac{\mathrm d}{\mathrm dx}\tan\left(\frac x2\right)=\frac12\left(1+\tan^2\left(\frac x2\right)\right)$ we may enforce the substition $\tan\left(\frac x2\right)=u$ to obtain

\begin{align*} I_n=\int_0^{\pi/2}\tan^n\left(\frac x2\right)\csc^2(x)\mathrm dx&=\int_0^{\pi/2}\tan^n\left(\frac x2\right)\left(\frac{1+\tan^2\left(\frac x2\right)}{2\tan\left(\frac x2\right)}\right)^2\mathrm dx\\ &=\frac12\int_0^{\pi/2}\tan^{n-2}\left(\frac x2\right)\left(1+\tan^2\left(\frac x2\right)\right)\left[\frac12\left(1+\tan^2\left(\frac x2\right)\right)\mathrm dx\right]\\ &=\frac12\int_0^1 u^{n-2}(1+u^2)\mathrm du\\ &=\frac12\left[\frac{u^{n-1}}{n-1}+\frac{u^{n+1}}{n+1}\right]_0^1\\ &=\frac12\left[\frac1{n-1}+\frac1{n+1}\right] \end{align*}

$$\therefore~I_n~=~\int_0^{\pi/2}\tan^n\left(\frac x2\right)\csc^2(x)\mathrm dx~=~\frac n{n^2-1}$$


Slightly different approach, same answer.

Let $u=\tan(x/2)$, then $$ \begin{align} \int_0^{\pi/2}\frac{\sin^{n-2}(x)}{(1+\cos(x))^n}\,\mathrm{d}x &=\int_0^{\pi/2}\tan^n(x/2)\csc^2(x)\,\mathrm{d}x\\ &=-\int_0^{\pi/2}\tan^n(x/2)\,\mathrm{d}\cot(x)\\ &=-\int_0^1u^n\,\mathrm{d}\frac{1-u^2}{2u}\\ &=\frac12\int_0^1\left(u^{n-2}+u^n\right)\mathrm{d}u\\[3pt] &=\frac12\left(\frac1{n-1}+\frac1{n+1}\right)\\[6pt] &=\frac{n}{n^2-1} \end{align} $$


Sorry for the late answer, but I just saw this in my feed and I'd like propose one more way of finding the integral:

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

If you want to completely avoid trig identities:

Let $\cos x=u$ then $$I=-\int_1^0(1+u)^{-n}(1-u^2)^{(n-3)/2}du=-\int _1^0(1+u)^{-(n+3)/2}(1-u)^{(n-3)/2}du$$

Let $z=1-u$ then $$I=\int_0^1 (2-z)^{-(n+3)/2}z^{(n-3)/2}dz$$

Again: let $2-z=t^2z$ which leads to $$dt=-\frac{z^{-3/2}}{\sqrt{2-z}}dz$$ or $$-z^2tdt=dz$$

$$I=-\int _\infty^1 (2-z)^{-n/2 -1} z^{n}dt=-\frac 12 \int_\infty^1 t^{-n-2}+t^{-n }dt=\frac 12 \left(\frac{t^{-n-1}}{-n-1}+\frac{t^{-n+1}}{-n+1}\right)^\infty_1$$

And finally $$I=\frac 12 \left(\frac{1}{n-1}+\frac{1}{n+1}\right)=\frac n{n^2-1}$$