The marginal PDF $f_X(x)$ can be calculated as $$f_X(x)=\int f_{X,Y}(x,y)dy=\int f_{X|Y}(x|y)f_Y(y)dy \tag{1}$$
However, I stuck in a particular case as follows.
$\mathbf{X}=[X_1,X_2]$ is uniform point on a circle having radius $R$. The radius $R$ is also a random variable with pdf $f_R(r)$.
The uniform distribution means $f_{X_1,X_2|R=r}(x_1,x_2|r)=\frac{1}{2\pi r}$ where $2 \pi r$ is circumference.
Hence $f_{X_1,X_2,R}(x_1,x_2,r)=\frac{1}{2\pi r} \times f_R(r) \tag{2}$.
As my purpose is to calculate $f_{X_1,X_2}(x_1,x_2)$, I use marginal pdf property
$$f_{X_1,X_2}(x_1,x_2) = \int f_{X_1,X_2,R}(x_1,x_2,r)dr= \int \frac{1}{2\pi r} f_R(r) dr \tag{3}$$
The integral of a function of $r$ over the domain of $r$ will be something that does not depend on $r$. Finally, $f_{X_1,X_2}(x_1,x_2)$ does not depend on $r$ and because $r$ is the only variable, $f_{X_1,X_2}(x_1,x_2)$ is constant. This must be wrong.
Question 1: Could anyone please show me where I was wrong and how to fix it?
Updated
I tried another way $$f_{X_1,X_2,R}(x_1,x_2,r) = f_{R|X_1=x_1,X_2=x_2}(r|x_1,x_2) f_{X_1,X_2}(x_1,x_2) = \delta\left(R=\sqrt{x_1^2+x_2^2}\right) f_{X_1,X_2}(x_1,x_2)\tag{4}$$ where $\delta$ is the Dirac delta function.
Question 2: How could I derive $f_{X_1,X_2}(x_1,x_2)$ from $f_{X_1,X_2,R}(x_1,x_2,r)$?
Since
$$f_{X_1,X_2|R=r}(x_1,x_2|r)=\frac{1}{2\pi r} 1_{x_1^2 + x_2^2 = r^2}$$
You have that
$$f_{X_1,X_2}(x_1,x_2) = \int f_{X_1,X_2,R}(x_1,x_2,r)dr= \int_0^\infty \frac{1}{2\pi r} f_R(r) 1_{x_1^2 + x_2^2 = r^2}dr $$
The integrand is equal to $0$ whenever $r \neq \sqrt{x_1^2 + x_2^2}$. So the integral is simply
$$f_{X_1,X_2}(x_1,x_2) = \frac{1}{2\pi \sqrt{x_1^2 + x_2^2}} f_R\left(\sqrt{x_1^2 + x_2^2}\right)$$