Convergence of $\int_0^{\pi/2}(\tan x)^p\,dx$ 
For what values of $p$ the integral is converge/diverge?
$$\int_{0}^{\pi/2} (\tan x)^p ~{\rm d}x$$

I tried use the fact that $\displaystyle{\tan x=\frac{\sin x}{\cos x}}$ but it didn't work.

First we note the definition of the Beta function: 
$$B(a,b)=\int_0^1t^{a-1}(1-t)^{b-1}dt=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}$$
Where $\Gamma(\cdot)$ is the Gamma function. 
Then we consider the integral 
$$I(a,b)=\int_0^{\pi/2}\sin^ax\ \cos^bx\ dx$$
Substituting $t=\sin^2x$ provides 
$$I(a,b)=\frac12\int_0^1t^{\frac{a-1}2}(1-t)^{\frac{b-1}2}dt$$
$$I(a,b)=\frac12\int_0^1t^{\frac{a+1}2-1}(1-t)^{\frac{b+1}2-1}dt$$
$$I(a,b)=\frac12B\bigg(\frac{a+1}2,\frac{b+1}2\bigg)$$
$$I(a,b)=\frac{\Gamma(\frac{a+1}2)\Gamma(\frac{b+1}2)}{2\Gamma(\frac{a+b}2+1)}$$
Since the identity I gave in the beginning holds for $\operatorname{Re}(a),\operatorname{Re}(b)>0$, we know that $I(a,b)$ holds for 
$$\operatorname{Re}(a),\operatorname{Re}(b)>-1$$
And thus your integral 
$$\int_0^{\pi/2}\tan^pt\ dt=I(p,-p)$$
Holds for $$\operatorname{Re}(p)>-1,\qquad \operatorname{Re}(-p)>-1\\\therefore -1<\operatorname{Re}(p)<1$$
