Integral $\int_{0}^{\pi}\frac{\sin^px}{1+\cos x} dx $ How to solve the following integral, using Euler functions (Gamma, Beta, and Phi):

$$\int_{0}^{\pi}\frac{\sin^px}{1+\cos x} dx $$

I got this integral from "Collection of problems in mathematical analysis, Kudryavtsev. Book 3.". Under the theme "Euler functions".
There are also functions, which can help:
\begin{align*}
\phi(p) &= \beta(p,1-p)= \frac{\pi}{\sin(p\pi)}\\
\phi'(p) &= - \frac{\pi^2\cos(p\pi)}{\sin^2(p\pi)}\\
\phi''(p) &=  \frac{\pi^3}{\sin(p\pi)}\left(\cot^2(p\pi)+\frac1{\sin^2(p\pi)}\right)
\end{align*}
 A: Using $1+\cos(x)=2\cos^2(x/2)$ we see that
$$\begin{align}
\int_0^\pi \frac{\sin^p(x)}{1+\cos(x)}\,dx&=\int_0^\pi \frac{\sin^p(x)}{2\cos^2(x/2)}\,dx\\\\
&=\int_0^{\pi/2} \frac{\sin^p(2x)}{\cos^2(x)}\,dx\\\\
&=2^p\int_0^{\pi/2} \sin^p(x)\cos^{p-2}(x)\,dx\\\\
&=2^{p-1}\text{B}\left(\frac{p+1}{2},\frac{p-1}{2}\right)\\\\
&=2^{p-1}\text{B}\left(\frac{p-1}{2}+1,\frac{p-1}{2}\right)\tag1\\\\
&=\text{B}\left(\frac12,\frac{p-1}{2}\right)\tag2
\end{align}$$
where in going from $(1)$ to $(2)$ we used the identities $\text{B}(x,y)=\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}$, $\Gamma(x+1)=x\Gamma(x)$, and
$$\frac1{\Gamma(2x)}=2^{1-2x}\frac{\Gamma(1/2)}{\Gamma(x)\Gamma(x+1/2)}=2^{1-2x}\frac{\text{B}\left(\frac12,x\right)}{
\Gamma^2(x)}$$
A: $$\int_{0}^{\pi}\frac{\sin^px}{1+\cos x} dx\overset{\cos x=u }=\int_{-1 }^1\frac{(1-u^2)^{\frac{p-1}{2}}}{1+u}du=\int_{-1}^1\frac{(1-u^2)^{\frac{p-1}{2}}(1-u)}{1-u^2}du$$
$$=\int_{-1}^1(1-u^2)^{\frac{p-3}{2}}dx-\underbrace{\int_{-1}^1 u(1-u^2)^{\frac{p-3}{2}}du}_{=0 \ (\text{odd})}\overset{u^2=t}=\int_0^1 t^{-1/2} (1-t)^{\frac{p-3}{2}}dt=\beta\left(\frac12,\frac{p-1}{2}\right)$$
A: Since$$\operatorname{B}\left(a,\,\frac12\right)=2\int_0^{\pi/2}\sin^{2a-1}xdx=\int_0^\pi\sin^{2a-1}xdx,$$another option is to write the integral as$$\int_0^\pi\sin^{p-2}x(1-\cos x)dx=\int_0^\pi\sin^{p-2}xdx=\operatorname{B}\left(\frac{p-1}{2},\,\frac12\right),$$where the cosine term disappears because $\sin^{p-2}x\cos x$ changes sign under $x\mapsto\pi-x$. Yet another option is to use$$\int_0^\pi f(x)dx=\int_0^{\pi/2}(f(x)+f(\pi-x))dx$$with$$\sum_\pm\frac{1}{1\pm\cos x}=2\sin^{-2}x$$to rewrite the original integral as$$2\int_0^{\pi/2}\sin^{p-2}xdx=\operatorname{B}\left(\frac{p-1}{2},\,\frac12\right).$$
