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}

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.)