$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove armada]{\displaystyle{#1}}\,}
\newcommand{\llaves}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\newcommand{\ic}{\mathrm{i}}
\newcommand{\mc}[1]{\mathcal{#1}}
\newcommand{\mrm}[1]{\mathrm{#1}}
\newcommand{\pars}[1]{\left(\,{#1}\,\right)}
\newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\parcial #3^{#1}}}
\newcommand{\raíz}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
\newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
\newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Set $\ds{x \equiv a + \pars{b - a}t}$:
\begin{align}
&\bbox[10px,#ffd]{\int_{a}^{b}x\pars{b - x}^{n - 1}
\pars{x - a}^{k - n}\,\dd x}
\\[5mm] = &\
\int_{0}^{1}\bracks{a + \pars{b - a}t}
\bracks{\pars{b - a}\pars{1 - t}}^{n - 1}
\bracks{\pars{b - a}t}^{n - k}\pars{b - a}\dd t
\\[5mm] = &\
\pars{b - a}^{2n -k}\bracks{%
a\int_{0}^{1}t^{n - k}\pars{1 - t}^{n - 1}\dd t +
\pars{b - a}\int_{0}^{1}t^{n - k + 1}\pars{1 - t}^{n - 1}\,\dd t}
\\[5mm] = &\
\pars{b - a}^{2n -k}\bracks{%
a\,{\Gamma\pars{n - k + 1}\Gamma\pars{n} \over
\Gamma\pars{2n - k + 1}} +
\pars{b - a}{\Gamma\pars{n - k + 2}\Gamma\pars{n} \over
\Gamma\pars{2n - k + 2}}}
\\[5mm] = &\
\pars{b - a}^{2n -k}\bracks{%
a\,{\Gamma\pars{n - k + 1}\Gamma\pars{n} \over
\Gamma\pars{2n - k + 1}} +
\pars{b - a}{\pars{n - k + 1}\Gamma\pars{n - k + 1}\Gamma\pars{n} \over
\Gamma\pars{2n - k + 2}}}
\\[5mm] = &\
\bbx{\pars{b - a}^{2n - k}\,\bracks{\pars{a + b}n - bk + b}\,
{\Gamma\pars{n - k + 1}\Gamma\pars{n} \over
\Gamma\pars{2n - k + 2}}}
\end{align}