Pre-requisites
I have seen in Wikipedia that it says for independent r.v. $X \sim G(m), Y \sim G(n)$ the ratio $X/Y \sim B'(m,n)$.Where $G(x)$ denotes the standard Gamma distribution $$ f(x,\lambda)= \begin{cases} \frac{e^{-x} x^{\lambda -1}}{\Gamma (\lambda )} & x>0, \lambda >0\\ 0 &\text{otherwise} \end{cases}$$
and $B'(m,n)$ denotes the Beta prime distribution, $$ f(x,m,n)=\begin{cases} \frac{1}{\beta(m,n)}\frac{x^{m-1}}{(1+x)^{m+n}} & x,m,n>0\\ 0 & \text{otherwise} \end{cases} $$
Question
How can I prove the fact that for independent r.v. $X,Y$ such that $X \sim G(m), Y \sim G(n)$ the ratio $X/Y \sim B'(m,n)$.I have seen the statement in questions here too (distribution of the ratio of two gamma random variables) but not the complete proof.
My attempt
I attempted to find the distribution of $X/Y$ by just multiply the pdfs of $X, 1/Y$ since they are independent to get the distribution of $X/Y$.I believe there must be some fundamental flaw here since this doesn't work. I am writing it out for completeness sake but would greatly appreciate someone telling me what I am doing wrong.
Let $u=1/y$ it's range is $[0,\infty)$ and its Jacobian $|J|$ is given by $\frac{1}{u^2}$. Using this we compute the pdf of $u$ as \begin{align} h(u)&=f(y) |J|\\ &=\frac{e^{-y}y^{n-1}}{\Gamma(n)} |J|\\ &\text{Substituting $y=1/u$}\\ &= \frac{e^{-1/u}(1/u)^{n-1}}{\Gamma(n)}\frac{1}{u^2}\\ &=\frac{e^{-1/u}u^{-(n+1)}}{\Gamma(n)} \end{align} So as expected $U=1/Y$ follows the Inverse-Gamma distribution.
But now if we compute the joint distribution of $X \cdot U=X/Y$ we get what is basically just the product of Gamma distribution and inverse-gamma distribution. This isn't the Beta prime distribution.
This product does seem to be a valid joint pdf since its double integral evaluates to 1 but it isn't the ratio distribution that was desired.
I'm afraid the joint distribution $X \cdot U$ isn't actually the ratio distribution. Could someone please explain where my reasoning is wrong? And what the correct method to prove this is?