Question: Evaluate: $$ \int_{0}^{1}x^m(1-x)^n dx$$ where $m, n$ are positive integers.
The hint is to interpret the probability as an integral.
What I've tried: For a fixed $x \in [0,1]$, $x^m(1-x)^n$ is the probability that you get $m$ heads followed by $n$ tails when you toss a coin (with heads probability $x$) $m+n$ times. Another way to write this is: $$P(\text{$m$ heads followed by $n$ heads } | \text{ Get $m$ heads within the $m+n$ tosses}) \times P(\text{Get $m$ heads within the $m+n$ tosses}) $$
Notice that if you know that there are $m$ heads, each of the ${m +n \choose n}$ outcomes are equally likely so we can reduce the above product of probabilities to: $\frac{1}{{m +n \choose n}} \cdot P(\text{Get $m$ heads within the $m+n$ tosses})$.
Now suppose $x$ is not fixed but rather chosen uniformly at random from $[0,1]$, then the probability that we get $m$ heads followed by $n$ tails is exactly the integral in the question above. Due to the discussion in the paragraph above, we can write this as:
$$\frac{1}{{m +n \choose n}} \int_{0}^{1} P(\text{Get $m$ heads within the $m+n$ tosses } | \text{ Heads probability is $x$}) dx$$ I do not know how to evaluate the above integral, however some numerical trials on WolframAlpha indicate that it should be $\frac{1}{m+n+1}$ giving a final answer of $\frac{1}{(m+n+1){m +n \choose n}}$.
I have no clue if this is on the right track and would appreciate any help.