Random Variables as Sums of Different Random Variables for $R = \sqrt{X^2 + Y^2}$ I am trying to understand the derivation of the PDF of $$R = \sqrt{X^2 + Y^2}$$
I am looking at some derivations and some derivations say that if $X$ and $Y$ are independent, then we can say that $$f_{X,Y} = f_X f_Y$$ which is just the law of independence for joint distributions. I don't really understand how we can break up $R$ into $2$ marginals which are both just the marginals of $X$ and $Y$.
For reference, I am trying the simplest example, where $X$ and $Y$ are uniform random variables from $0$ to $1$. I'll attach some of my work just so maybe someone can help me move forward too.
WORK THUS FAR
Let $R = \sqrt{X^2 + Y^2}$. Then, $$P(R \leq r) = P(\sqrt{X^2 + Y^2} \leq r) = P(X^2 + Y^2 \leq r^2)$$
Then, we know that the bounds are on the unit circle so we are solving:
$$F_R = \int_{-r}^{r}\int_{-\sqrt{r^2-y^2}}^{\sqrt{r^2-y^2}}f_{XY}dxdy$$
I'm stuck here.
Thanks.
 A: Now let me suppose that $X$ and $Y$ are valued in $\mathbb{R^+} = (0, \infty)$ and $S \colon = X/Y$.
Then we have
$$
\begin{cases}
X = \frac{RS}{\sqrt{1+S^2}} \\
Y = \frac{R}{\sqrt{1+S^2}} 
\end{cases}
$$
Denote the density of $(X, Y)$ and $(R, S)$ by $f(x, y)$ and $g(r, s)$ respectively.
We can prove (maybe has been proved in the probability course) that
$$
g(r, s) = \left.
f\left( \frac{rs}{\sqrt{1+s^2}}, \frac{r}{\sqrt{1+s^2}} \right) \middle/
\left| 
\begin{pmatrix}
r_x & r_y \\
s_x & s_y
\end{pmatrix}
\right| 
\right.
$$
where $r_x = \frac{\partial r}{\partial x} = \frac{x}{\sqrt{x^2+y^2}}$ and it is similar to calculate9 $r_y, s_x, s_y$. Inserting into the above equation yields that
$$
g(r, s) = \left.
f\left( \frac{rs}{\sqrt{1+s^2}}, \frac{r}{\sqrt{1+s^2}} \right) \frac{r}{1+s^2}\right.
$$
Then by integrating on $s$ the marginal density $g(r)$ of $R$ is given the following formula.
$$
g(r) = \int_0^\infty \left.
f\left( \frac{rs}{\sqrt{1+s^2}}, \frac{r}{\sqrt{1+s^2}} \right) \frac{r}{1+s^2}
\right.\ ds
$$
If we add the assumption that $X$ and $Y$ are indenpent which implies that $f(x, y) = f_X(x) f_y(y)$. Substituting $f$ by $f_Xf_Y$ simplify the formula.
$$
g(r) = \int_0^\infty \left.
f_X\left( \frac{rs}{\sqrt{1+s^2}}\right)f_Y\left(\frac{r}{\sqrt{1+s^2}} \right) \frac{r}{1+s^2}
\right.\ ds
$$
Actually I do think the formula is ugly which makes me suspend that if there is any wrong above.

Update: I have veirfied the formula and it should be correct.
For uniform, $f_X(x) = I(0 < x < 1)$ and $f_Y(y) = I(0 < y< 1)$.
Hence
$$
g(r) = \int_0^\infty I\left(0<\frac{rs}{\sqrt{1+s^2}}<1\right) I\left(0<\frac{r}{\sqrt{1+s^2}}<1\right) \frac{r}{1+s^2}\ ds
=\int_D \frac{r}{1+s^2} ds
$$
where $D$ is the joint of $D_1 = \{s: 0<\frac{rs}{\sqrt{1+s^2}}<1\}$ and $D_2 = \{0<\frac{r}{\sqrt{1+s^2}}<1\}$.
Case 1: $0<r<1, D = \mathbb{R}^+, g(r) = \frac\pi2 r$;
Case 2: $1 \le r < \sqrt2, D = (\sqrt{r^2-1}, 1/\sqrt{r^2-1}), g(r) = r(\tan 1/\sqrt{r^2-1} - \tan \sqrt{r^2-1})$;
Case 3: $\sqrt 2 \le r, D = \phi, g(r) = 0$.
