I need to solve the following exercise and I am not fully sure about my approach as the results seem odd and therefore would like some advise.
Given are uniform random distributions of an angle $\theta \in [0,2\pi)$ and radius $r \in [0,1]$, both independent. Calculated shall be the marginal pdfs of the according cartesian coordinates as well as their expectation and variance.
From my understanding the marginal pdfs in polar coordinates are $f(\theta)=\frac{1} {2\pi}$ for $\theta \in [0, 2\pi)$ and $f(r)=1$ for $r\in [0,1]$ and therefore the joint pdf $f_{\theta r}=\frac{1} {2\pi}$ for $\theta \in [0,2\pi)$ and $r\in[0,1]$ and $0$ elsewhere. Based on the transformation $x=r\cdot cos(\theta)$ and $y=r\cdot sin(\theta)$ and their inverses $r=\sqrt{x^2+y^2}$ and $\theta=\arctan(\frac{y} {x})$ the Jacobian calculates as $J=\frac{1}{\sqrt{x^2+y^2}}$.
Finally, the joint pdf for x & y can be derived as $$ f_{xy}(x, y)=f_{\theta r}(\sqrt{x^2+y^2}, \arctan(\frac{y} {x})\cdot \frac{1}{\sqrt{x^2+y^2}}\\ =\frac{1}{2\pi\sqrt{x^2+y^2}} $$ Based on this the marginal pdf for x can be calculated as $$ f_x(x,y)=\frac{1}{2\pi}\int_{0}^{\sqrt{1-x^2}} \frac{1}{\sqrt{x^2+y^2}} \,dy\\ =\frac{1}{4\pi}[log(\sqrt{1-x^2}+1)-log(1-\sqrt{1-x^2})] $$ For the expectation this gives: $$ E(x)=\int_{\infty}^{\infty}x \cdot f_x(x,y)\,dx=0 $$ For the variance I am struggling to compute it, but it should be $$ Var(x)=E(x^2)-(E(x))^2=\int_{\infty}^{\infty}x^2 \cdot f_x(x,y)\,dx-0 $$
Believe you made an error with your marginal pdf for x. The results should be: After substituting y for x tan(u) your limits would change from 0 to $\arctan(\frac{\sqrt{1-x^2}} {x}) $and you would be integrating $$f_{X}(x)=\frac{1} {2\pi} \int_{0}^{\arctan(\frac{\sqrt{1-x^2}} {x})}\sec(u) \,du$$
which would result in: $$f_{X}(x)=\frac{1} {2\pi} (log(\tan(u))+\sec(\arctan(u)))$$ to then be valuated at 0 and $\arctan(\frac{\sqrt{1-x^2}} {x})$
This should result in the marginal pdf $$f_{X}(x)=\frac{1} {2\pi} log(\frac{\sqrt{1-x^2}+1} {x})$$