Irresistible: $T(p)=\int_0^{\pi/2}x\tan(x)^p\mathrm dx$ for $-2I am working on a challenge posed to me by the book Irresistible Integrals, finding a closed form for the integral
$$T(p)=\int_0^{\pi/2}x\tan(x)^p\mathrm dx,\qquad -2<p<1$$
I am confident that a closed form exists, because the book tells me to find it.
My efforts:
$$T(p)=\int_0^{\pi/2}x\tan(x)^p\mathrm dx$$
$x=\arctan u$:
$$I(p)=\int_0^\infty \frac{u^p}{1+u^2}\arctan u\,\mathrm du$$
$u=\frac1t$:
$$T(p)=\int_0^{\infty}\frac{t^{-p}}{1+\frac{1}{t^2}}\arctan(1/t)\frac{\mathrm dt}{t^2}$$
$$T(p)=\frac\pi2\int_0^{\infty}\frac{t^{2-p}}{1+t^2}\mathrm dt-\int_0^\infty \frac{t^{2-p}}{1+t^2}\arctan t\,\mathrm dt$$
$$T(p)=\frac\pi2J(p)-T(2-p)$$
Then focusing on 
$$J(p)=\int_0^{\infty}\frac{t^{2-p}}{1+t^2}\mathrm dt$$
As I have shown before, this integral relates to the Beta function:
$$\int_0^{\infty}\frac{t^{2b-1}\mathrm dt}{(1+t^2)^{a+b}}=\frac12\mathrm{B}(a,b)=\frac{\Gamma(a)\Gamma(b)}{2\Gamma(a+b)}$$
So $$J(p)=\frac12\Gamma\left(\frac{p-1}2\right)\Gamma\left(\frac{3-p}2\right)$$
But this only works for $p\in(1,3)$, so I'm thinking that my functional equation is entirely false. 
Does anyone know how to evaluate this integral? Thanks.
Edit:
As was noted in the comments, we have 
$$T(p)=\frac\pi2\int_0^\infty \frac{t^{-p}}{1+t^2}\mathrm dt-\int_0^\infty \frac{t^{-p}}{1+t^2}\arctan t\,\mathrm dt$$
So redefining $J(p)=\int_0^\infty \frac{t^{-p}}{1+t^2}\mathrm dt$ We have that 
$$J(p)=\frac12\Gamma\left(\frac{1-p}2\right)\Gamma\left(\frac{1+p}2\right)$$
Then if we recall that 
$$\Gamma(s)\Gamma(1-s)=\frac\pi{\sin\pi s}$$
$$\Gamma(s/2)\Gamma(1-s/2)=\frac\pi{\sin\frac{\pi s}2}$$
$$\Gamma\left(\frac{1+s}2\right)\Gamma\left(\frac{1-s}2\right)=\frac\pi{\sin\frac{\pi(s+1)}2}=\frac\pi{\cos\frac{\pi s}2}$$
So 
$$T(p)+T(-p)=\frac{\pi^2}{4\cos\frac{\pi p}2}$$
 A: Let $\Omega = \{p \in \mathbb{C} \,\colon -2 < \operatorname{Re}(p) < 1 \}$. For $p \in \Omega$ we define the function
$$ f_p \, \colon [0,1] \to \mathbb{C} \, , \, f_p (x) = \int \limits_0^\infty \frac{u^p}{1+u^2} \arctan(x u) \, \mathrm{d} u \, . $$
We have $f_p \in C^1 ([0,1],\mathbb{C})$, $f_p (0) = 0$ and, by your calculation, $f_p(1) = T(p)$ . Fixing $x \in (0,1)$, we note that $f_\cdot (x)$ is a holomorphic function on $\Omega$ and for $p \in \Omega$ with $\operatorname{Re}(p) > 0$ we have
\begin{align}
f_p '(x) &= \int \limits_0^\infty \frac{u^{p+1}}{(1+u^2)(1+x^2 u^2)} \, \mathrm{d} u = \frac{1}{1-x^2} \int \limits_0^\infty \left[\frac{u^{p-1}}{1+x^2 u^2} - \frac{u^{p-1}}{1+u^2} \right] \, \mathrm{d} u \\
&= \frac{x^{-p} - 1}{1-x^2} \frac{1}{2} \operatorname{B} \left(\frac{p}{2},1 - \frac{p}{2}\right) = \frac{\pi}{2 \sin \left(\frac{\pi}{2} p\right)} \frac{x^{-p} - 1}{1-x^2} \, ,
\end{align}
since both derivatives may be interchanged with the integral (essentially due to the dominated convergence theorem). However, the right-hand side is also a holomorphic function of $p \in \Omega$ (if we define $f_0(x) = \frac{-\ln(x)}{1-x^2}$ as the correct limit), so
$$ f_p'(x) = \frac{\pi}{2} \csc \left(\frac{\pi}{2} p\right) \frac{x^{-p} - 1}{1-x^2} $$
holds for every $p \in \Omega$ and $x \in (0,1)$ by the identity theorem. Using an integral representation of the digamma function we obtain
\begin{align}
T(p) &= f_p(1) = \int \limits_0^1 f_p'(x) \, \mathrm{d} x = \frac{\pi}{2} \csc \left(\frac{\pi}{2} p\right) \int \limits_0^1 \frac{x^{-p} - 1}{1-x^2} \, \mathrm{d} x \\
&= \frac{\pi}{4} \csc \left(\frac{\pi}{2} p\right) \int \limits_0^1 \frac{t^{-(1+p)/2} - t^{-1/2}}{1-t} \, \mathrm{d} t \\
&= \frac{\pi}{4} \csc \left(\frac{\pi}{2} p\right) \left[- \gamma + \int \limits_0^1 \frac{1 - t^{-1/2}}{1-t} \, \mathrm{d} t - \left(- \gamma + \int \limits_0^1 \frac{1 - t^{-(1+p)/2}}{1-t} \, \mathrm{d} t\right) \right] \\
&= \frac{\pi}{4} \csc \left(\frac{\pi}{2} p\right) \left[\psi\left(\frac{1}{2}\right) - \psi\left(\frac{1-p}{2}\right)\right]
\end{align}
for $p \in \Omega$ with the correct limit $T(0) = \frac{\pi^2}{8}$ .
