An integral related to the beta function: $\int_{-1}^{1} \frac{(1+x)^{2m-1}(1-x)^{2n-1}}{(1+x^{2})^{m+n}} \, dx $ I came across an exercise in a textbook that says to show that $$ \int_{-1}^{1} \frac{(1+x)^{2m-1}(1-x)^{2n-1}}{(1+x^{2})^{m+n}} \, dx = 2^{m+n-2} B(m,n), \ (m,n >0),$$ and then deduce that $$ \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}} \Big( \frac{\cos x + \sin x}{\cos x - \sin x} \Big)^{\cos \alpha} \, dx = \frac{\pi}{2 \sin \left( \pi \cos^{2} \frac{\alpha}{2}\right)}, $$ where $\alpha$ is not a multiple of $\pi$.
(Considering that $m$ and $n$ aren't necessarily integers here, using them for the parameters is perhaps a bit unconventional.)
I managed to figure out the second part of the exercise (which I'll show below), but not the first part. 
I assume that with the right substitution, one can show that $$\int_{-1}^{1} \frac{(1+x)^{2m-1}(1-x)^{2n-1}}{(1+x^{2})^{m+n}} \, dx = 2^{m+n-2} \int_{0}^{1} u^{m-1} (1-u)^{n-1} \, du.  $$

$$ \begin{align} \int_{-1}^{1} \frac{(1+x)^{2m-1}(1-x)^{2n-1}}{(1+x^{2})^{m+n}} \, dx  &= \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}} \frac{(1 + \tan u)^{2m-1}(1-\tan u)^{2n-1}}{\sec^{2(m+n)} (u)} \, \sec^{2} (u) \, du \\ &= \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}} (\cos u  + \sin u)^{2m-1}(\cos u - \sin  u)^{2n-1} \ du \end{align}$$ 
If we then let $\displaystyle m = \frac{1 + \cos \alpha}{2}$ and $\displaystyle n= \frac{1- \cos \alpha}{2}$, we get
$$ \begin{align} \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}} \Big( \frac{\cos x + \sin x}{\cos x - \sin x} \Big)^{\cos \alpha} \, dx &= \frac{1}{2} \frac{\Gamma \left(\frac{1 + \cos \alpha}{2} \right) \Gamma \left(\frac{1 - \cos \alpha}{2} \right)}{\Gamma (1)} \\ &= \frac{1}{2} \, \Gamma \left(\frac{1 + \cos \alpha}{2} \right) \Gamma \left( 1- \frac{ 1 + \cos \alpha}{2} \right) \\ &= \frac{1}{2} \, \frac{\pi}{\sin \, \left( \pi \frac{1+\cos \alpha}{2} \right)} \\ &= \frac{\pi}{2 \sin \left( \pi \cos^{2} \frac{\alpha}{2}\right)} . \end{align}$$

Let's prove the first part, you need change the variables.


*

*$y:=\frac{(1+x)^2}{2(1+x^2)}$, then $1-y=\frac{(1-x)^2}{2(1+x^2)}$, and $$\mathrm{d}y=\frac{1-x^2}{(1+x^2)^2}=2\cdot y^{\frac{1}{2}}\cdot (1-y)^{\frac{1}{2}}\cdot \frac{1}{1+x^2}\mathrm{d}x$$
Theorfore,
\begin{eqnarray}
&&\int_{-1}^{1}\frac{(1+x)^{2m-1}(1-x)^{2n-1}}{(1+x^2)^{m+n}}\mathrm{d}x \\
&=&\int_0^1 (2y)^{m-\frac{1}{2}}\cdot (2(1-y))^{n-\frac{1}{2}}\cdot\frac{1}{1+x^2} \big(2\cdot y^{\frac{1}{2}}\cdot (1-y)^{\frac{1}{2}}\cdot\frac{1}{1+x^2}\big)^{-1}\mathrm{d}y\\
&=&2^{m+n-2}\cdot \int_{0}^{1}y^{m-1}\cdot(1-y)^{n-1}\mathrm{d}y\\
&=&2^{m+n-2}\cdot B(m,n)
\end{eqnarray}

