Question:
Evaluate the integral $\int_0^1 \frac{x^n}{x^a(1-x)^{1-a}}\mathrm{d}x$ for any integer $n$, and find for what complex values of $a$ does it converge.
Progress:
This was in a section on residue calculus in a textbook, and it seems like an integral well-suited to a dogbone contour. Setting up the dogbone contour, there are no poles exterior to the contour except for at infinity.
My attempt at finding a Laurent series:
$\frac{z^n}{z^a(1-z)^{1-a}} = z^{n-1}(\frac{1}{z} - 1)^{a-1} = -e^{i\pi a}z^{n-1}(1- \frac{1}{z})^{a-1} \\= -e^{i\pi a}z^{n-1}(1 + (1-a)\frac{1}{z} + \frac{(1-a)*(2-a)}{2}\frac{1}{z^2}+ \frac{(1-a)(2-a)(3-a)}{6}\frac{1}{z^3} + ...)$
Hence $\mathrm{Res}\left[\frac{z^n}{z^a(1-z)^{1-a}},\infty\right] = -e^{i\pi a}\frac{(1-a)(2-a)...(n-a)}{n!}$. However this only applies when $n > 0$. When $n=0$ we simply have $\mathrm{Res}\left[\frac{z^n}{z^a(1-z)^{1-a}},\infty\right] = -e^{i\pi a}$ and when $n < 0$ we have $\mathrm{Res}\left[\frac{z^n}{z^a(1-z)^{1-a}},\infty\right] = 0$.
Evaluating the integral we have: $2\int_\epsilon^{1-\epsilon} \frac{x^n}{x^a(1-x)^{1-a}}\mathrm{d}x + \int_{C_\epsilon} f(z)\mathrm{d}z + \int_{\gamma_{\epsilon}} f(z)\mathrm{d}z = -2\pi i\mathrm{Res}\left[\frac{z^n}{z^a(1-z)^{1-a}},\infty\right]$ where ${C_\epsilon}$ and $\gamma_{\epsilon}$ are the two circles at either end of the dogbone contour.
$\left|\int_{C_\epsilon} f(z)\mathrm{d}z\right| \leq 2\pi \epsilon \frac{\epsilon^n}{\epsilon^a} = 2\pi \epsilon^{n-a+1}$ which converges to $0$ when $n-a+1\geq 0$ which is when $n+1 \geq a$.
Similarly, $\left|\int_{\gamma_\epsilon} f(z)\mathrm{d}z\right| \leq 2\pi \epsilon \frac{1}{\epsilon^a} = 2\pi \epsilon^{1-a}$ which converges to $0$ when $1-a\geq 0$ which is when $1 \geq a$.
So we have: $\int_0^1 \frac{x^n}{x^a(1-x)^{1-a}}\mathrm{d}x = -i\pi \mathrm{Res}\left[\frac{z^n}{z^a(1-z)^{1-a}},\infty\right]$ when $a \leq n+1$ and $a \leq 1$. Considering cases we have:
$\int_0^{1} \frac{x^n}{x^a(1-x)^{1-a}}\mathrm{d}x = -i\pi e^{i\pi a}\frac{(1-a)(2-a)...(n-a)}{n!}$ when $n> 0$ and $a \leq 1$
$\int_0^{1} \frac{x^n}{x^a(1-x)^{1-a}}\mathrm{d}x = -i\pi e^{i\pi a}$ when $n=0$ and $a \leq 1$
$\int_0^{1} \frac{x^n}{x^a(1-x)^{1-a}}\mathrm{d}x = 0$ when $n<0$ and $a \leq 1 + n$
My main questions are is this right, and how should I evaluate this for complex values of a like the question asks? I am not quite sure. I feel like the answer would be the same but not the process. Thank you in advance!
EDIT: I have confirmed this for $a=\frac{1}{2}$ with some positive values of $n$.
The integral of interest could be transformed to $$\int_0^1x^{n-a}\left(1-x\right)^{a-1}dx$$
That could be written in terms of beta-function as $B(n-a+1,a)$ which is defined when $\text{Re}(n-a+1)>0, \text{Re}(a)>0$. So the initial integral is defined when $0<\text{Re}(a)<n+1$.