How to prove that $_2F_1 \left(\frac{n+2}{2},\frac{n+1}{2};\frac{3}{2};-\tan^2 z\right) = \frac{\sin nz \cos^{n+1}z}{n\sin z}$? Formula 9.121.19 of I. S. Gradshteyn and I. M. Ryzhik. - Table of Integrals, Series, and Products states that
$$_2F_1 \left(\frac{n+2}{2},\frac{n+1}{2};\frac{3}{2};-\tan^2 z\right) = \frac{\sin nz \cos^{n+1}z}{n\sin z}$$
Does anybody know about a proof?
I am interested in proving it because it arises in the evaluation of the integral
$$\int_0^1 \frac{x^{p-\frac{1}{2}}}{(1-x)^p(1+qx)^p}dx$$
 A: Method 1 
The hypergeometric equation
$$t(1-t)w''+\left[c-(a+b+1)t\right]w'-ab w=0$$
has two linearly independent solutions. One has the form $1+\sum_{k=1}^{\infty}\alpha_kt^k$ and another one $t^{1-c}(1+\sum_{k=1}^{\infty}\beta_kt^k)$ as $t\rightarrow 0$, with some coefficients $\alpha_k,\beta_k$. The former solution is called $_2F_1(a,b,c;z)$. Hence, to obtain the mentioned identity, it suffices to 


*

*Verify the differential equation
\begin{align}
\biggl\{-\tan^2z\left(1+\tan^2z\right)\frac{d}{d(\tan^2z)}\frac{d}{d(\tan^2z)}-\left[\frac32+\left(n+\frac52\right)\tan^2 z\right]\frac{d}{d(\tan^2z)}\\
-\frac{(n+1)(n+2)}{4}\biggr\}\frac{\sin n z\cos^{n+1}z}{n \sin z}=0.
\end{align}
This is straightforward differentiation and trigonometry.

*Verify the leading behaviour as $t\rightarrow 0$ (i.e. $z\rightarrow0$). Indeed, $\displaystyle \frac{\sin n z\cos^{n+1}z}{n \sin z}\rightarrow 1$ for $z\rightarrow 0$.
Note that one doesn't need to assume that $n$ is an integer.
Method 2
Although the above method provides a relatively easy proof, it doesn't explain why such an identity should hold. One of the things behind it is the existence of the so-called quadratic transformations for Gauss hypergeometric function. In particular, one has
$$_2F_1(a,b,2b;s)=\left(1-\frac{s}{2}\right)^{-a}{}_2F_1\left(\frac{a}{2},\frac{a+1}{2},b+\frac12;\left(\frac{s}{2-s}\right)^2\right).$$
Setting $a=n+1$, $b=1$ in this formula, we obtain
$$_2F_1(n+1,1,2;s)=\left(1-\frac{s}{2}\right)^{-n-1}{}_2F_1\left(\frac{n+1}{2},\frac{n+2}{2},\frac32;\left(\frac{s}{2-s}\right)^2\right).\tag{1}$$
On the right we have the hypergeometric function from the identity we want to prove. The hypergeometric function on the left, on the other hand, can be easily shown (e.g. by using the standard integral representation for $_2F_1$) to be elementary:
$$_2F_1(n+1,1,2;s)=\frac{(1-s)^{-n}-1}{ns}.\tag{2}$$
Your identity is obtained from (1) and (2) after setting $s=1-e^{-2iz}$.
