TITLE: integration of $(1-x)^mx^n$ from $0$ to $1$, $m$ and $n$ positive integers
QUESTION [5 upvotes]: trying to integrate $\int_0^1 (1-x)^m x^n dx$, $m$ and $n$ positive integers. I know the answer is a fraction containing gamma functions but don't know how to get there

REPLY [5 votes]: Another approach, that is closely related to the Beta function, is to integrate by parts, assuming $m\gt0$
$$
\begin{align}
\int_0^1(1-x)^mx^n\,\mathrm{d}x
&=-\frac1{n+1}\int_0^1(1-x)^m\,\mathrm{d}x^{n+1}\\
&=\frac1{n+1}\int_0^1x^{n+1}\,\mathrm{d}(1-x)^m\\
&=\frac{m}{n+1}\int_0^1(1-x)^{m-1}x^{n+1}\,\mathrm{d}x\tag{1}
\end{align}
$$
We can iterate $(1)$ to get
$$
\begin{align}
\int_0^1(1-x)^mx^n\,\mathrm{d}x
&=\frac{m}{n+1}\frac{m-1}{n+2}\cdots\frac1{n+m}\int_0^1x^{n+m}\,\mathrm{d}x\\
&=\frac{m}{n+1}\frac{m-1}{n+2}\cdots\frac1{n+m}\frac1{n+m+1}\\
&=\frac{n!\,m!}{(n+m+1)!}\\
&=\frac{\Gamma(n+1)\Gamma(m+1)}{\Gamma(n+m+2)}\\[6pt]
&=\mathrm{B}(n+1,m+1)\tag{2}
\end{align}
$$
If $m=0$, then $(2)$ does not need iteration.
In fact, the Beta function is often defined as
$$
\mathrm{B}(x,y)=\int_0^1t^{x-1}(1-t)^{y-1}\,\mathrm{d}t\tag{3}
$$