Evaluate an integral using hypergeometric functions I would like to derive the following indefinite integral using hypergeometric functions.
\begin{equation}
S=\int \left(\frac{\alpha-x}{\beta-x}\right)^\lambda dx,
\end{equation}
where $0<x<\beta<\alpha$ and $\lambda$ is a positive real number.
I tried to employ the integral representation of a hypergeometric function as
\begin{equation}
{}_2F_1(a,b;c;z) = \frac{\Gamma(c)}{\Gamma(b)\Gamma(c-b)}\int_{0}^{1} t^{b-1}(1-t)^{c-b-1}(1-zt)^{-a}dt
\end{equation}
to do that; however, my attemp does not succeed. What I have done is
\begin{align}
S &= \int_{0}^{x} (\alpha-t)^\lambda(\beta-t)^{-\lambda}dt\\
&=x\int_{0}^{1} (\alpha-xt)^\lambda(\beta-xt)^{-\lambda}dt\\
&=x\left(\frac{\alpha}{\beta}\right)^\lambda \int_{0}^{1}\left(1-\frac{xt}{\alpha}\right)^\lambda\left(1-\frac{xt}{\beta}\right)^{-\lambda}dt.
\end{align}
If I tried to match the form of the expression inside the integral, the interval would not be satified.
The result returned from Wolframalpha is

I then tried another time, but still got stuck. I appreciate if anyone can help to explain the result derived by Wolframalpha.
\begin{equation}
S = \frac{1}{\lambda-1}\int_{x_0}^{x} (\alpha-t)^\lambda d\left[(\beta-t)^{1-\lambda}\right].
\end{equation}
 A: Let $x\mapsto\beta+u,u\mapsto(\alpha-\beta)t$ to get
$$\begin{align}S&=e^{-\lambda\pi i}\int(\alpha-\beta-u)^\lambda u^{-\lambda}~\mathrm du\\&=e^{-\lambda\pi i}(\alpha-\beta)\int(1-t)^\lambda t^{-\lambda}~\mathrm dt\\&=e^{-\lambda\pi i}(\alpha-\beta)B(t;1+\lambda,1-\lambda)+C\\&=e^{-\lambda\pi i}(\alpha-\beta)B\left(\frac{x-\beta}{\alpha-\beta};1+\lambda,1-\lambda\right)+C\\&=\frac{e^{-\lambda\pi i}(\alpha-\beta)}{1+\lambda}\left(\frac{x-\beta}{\alpha-\beta}\right)^{1+\lambda}~_2F_1\left(1+\lambda,\lambda;2+\lambda;\frac{x-\beta}{\alpha-\beta}\right)+C\\&=\frac{(\beta-\alpha)^{-\lambda}(x-\beta)^{1+\lambda}}{1+\lambda}~_2F_1\left(1+\lambda,\lambda;2+\lambda;\frac{x-\beta}{\alpha-\beta}\right)+C\end{align}$$
Where we used the incomplete beta function.
(probably differs from WA by a constant.  Likely, it used $x\mapsto\alpha+u,u\mapsto(\beta-\alpha)t$ and the rest looks pretty much the same.)
A: Another solution.
If you let $$\frac{\alpha-x}{\beta-x}=t \implies x=\frac{\beta  t-\alpha }{t-1}\implies dx=\frac{\alpha -\beta }{(1-t)^2}\,dt$$ you will end with 
$$S=\int \left(\frac{\alpha-x}{\beta-x}\right)^\lambda dx=(\alpha -\beta )\int\frac{ t^{\lambda }}{(1-t)^2}\,dt=\frac{(\alpha -\beta )}{\lambda -1 }\frac{ t^{\lambda +1} }{ (1-t)^2}\, _2F_1\left(1,2;2-\lambda
   ;\frac{1}{1-t}\right)$$ If you want to go back to $x$, use $$t=\frac{\alpha -x}{\beta -x}\implies 1-t=\frac{\alpha -\beta }{x-\beta }\implies\frac{1}{1-t}=\frac{x-\beta }{\alpha -\beta }$$
A: Consider:
$$I_{\lambda} = \int \left(\frac{\alpha - x}{\beta - x} \right)^{\lambda} \, dx$$
for which the following is obtained.
Let $u = \alpha - x$ to obtain
\begin{align}
I_{\lambda} &= - \int u^{\lambda} \, (\beta - \alpha + u)^{- \lambda} \, du \\
&= (-1)^{\lambda + 1} \, (\alpha - \beta) \, \int t^{\lambda} (1-t)^{-\lambda} \, dt \hspace{5mm} \text{ where $u = (\alpha - \beta) \, t$ } \\
&= (-1)^{\lambda + 1} \, (\alpha - \beta) \, \frac{t^{\lambda + 1}}{1 - \lambda} \, {}_{2}F_{1}(-\lambda, 1 - \lambda; 2 - \lambda; t) \\
&= \frac{\alpha - \beta}{1- \lambda} \, \left(\frac{x-\alpha}{\alpha - \beta}\right)^{\lambda +1} \, {}_{2}F_{1}\left(- \lambda , 1-\lambda; 2 - \lambda; \frac{\alpha - x}{\alpha - \beta} \right) + c_{0}.
\end{align}
From this form it is noticed that if $\lambda =1 $ there will be a problem with the solution in terms of the hypergeometric function. The case of $\lambda = 1$ is given by
$$I_{1} = \int \frac{\alpha - x}{\beta - x} \, dx = x - (\alpha - \beta) \, \ln(x - \beta) + c_{1}.$$
