I was reading https://en.wikipedia.org/wiki/Ratio_distribution#Other_ratio_distributions and I find the following problem: Let $X$ and $Y$ be independent $\chi ^2 $ with $m$ and $n$ degrees of freedom then $\dfrac{X}{X+Y} = \beta(m/2, n/2)$. Where $\chi^2(k)$ has density function $$f_{\chi^2(k)}(x)=\begin{cases}\displaystyle \frac{1}{2^{k/2}\Gamma(k/2)}\,x^{(k/2) - 1} e^{-x/2}&\text{if }x>0,\\ 0&\text{if }x\le0 \end{cases} $$
I proved that $X+Y$ is $\chi ^2$ with $n + m$ degrees of freedom using the moment-generating function. If $Z=X+Y$ and $U=\dfrac{X}{X+Y}=\dfrac{X}{Z}$ using the formula for the density of the ratio of two independent random variables: $$f_U(u)= \int_{-\infty}^{\infty}f_X(uv)f_Z(v)|v|dv $$
then
$$\dfrac{u^{m/2-1}}{2^{(m+n/2)} \Gamma(m/2) \Gamma((m+n)/2)} \int_0^{\infty} v^{m+\dfrac{n}{2}-1} e^{-(v/2)(u+1)}dv $$
and using some algebra:
$$f_U(u)=\dfrac{u^{m/2-1} \Gamma(m+n/2)}{\Gamma(m+n/2) \Gamma(m/2) (u+1)^{m+n/2}}$$
and this is not $\beta(m/2, n/2)$, it looks more like $\beta(m/2, m/2+n/2)$ but $(u+1)^{m+n/2}$ is causing troubles.
I need help if something is false or any hint.