# Multivariate random variable normalization PDF proof verification

It would help me if someone can verify the following two proofs I made for the statement below (it's regarding only the second proof).

Let us have a unit ball centered at $$(0,1,0)$$. And let $$(X,Y,Z)$$ be a multivariate random variable uniformly distributed in that ball. Then I want to prove/disprove the statement that the distribution of $$(X,Y,Z)/\sqrt{X^2+Y^2+Z^2}$$ is cosine distributed over the unit hemisphere, that is: $$p(\theta) = \frac{\cos\theta\sin\theta}{\pi}$$.

First let's consider the $$2D$$ case. For each point on the unit hemisphere $$(x,y) : x = r\sin\theta, y = r\cos\theta, \theta \in [-\pi/2,\pi/2], r = 1$$, I find the intersection of the ray starting at $$(0,0)$$ with direction $$(x,y)$$ with the unit circle centered at $$(0,1)$$, with canonical equation $$x^2+(y-1)^2=1$$. Plugging in x and y I solve for r: $$r^2\sin\theta+r^2\cos\theta - 2r\cos\theta + 1 - 1 = 0$$, $$r(r-2\cos\theta)=0$$. Obviously one of the roots is $$0$$ and the other is $$r = 2\cos\theta$$. Then the first intersection point is $$(0,0)$$ and the second is $$(2\cos\theta\sin\theta,2\cos^2\theta)$$. Considering that, I argue that the probability density function induced by the normalization transformation is $$p(\theta)=\frac{\cos\theta}{2}$$ over the unit hemicircle. Here's the part I am not so sure about: since we have uniformly distributed points in the unit ball, then the probability for picking a specific direction $$\theta$$ is $$p(\theta) = C|(2\cos\theta\sin\theta,2\cos^2\theta)|$$. I am not certain that I can do this - precisely using the distance as the corresponding probability, since I do not provide justification about this except for the fact that it 'follows' from the fact that the distribution inside the ball is uniform, so I can integrate it along each ray to get the corresponding probability for picking a point onto the unit hemisphere in that direction $$\theta$$. Expanding $$p(\theta) = C\sqrt{4\cos^2\theta\sin^2\theta + 4\cos^4\theta} = 2C|\cos\theta|$$. After integrating: $$\int_{-\pi/2}^{\pi/2}{2C|\cos\theta|d\theta} = 1$$, one gets $$C = 1/4$$, and $$p(\theta) = \frac{\cos\theta}{2}$$.

The $$3D$$ case is similar. Once again we generate the ray: $$x=r\sin\theta\cos\phi, y=r\cos\theta, z=r\sin\theta\sin\phi$$, and intersect it with $$x^2 + (y-1)^2 + z^2 = 1$$. Plugging in the ray equation into the canonical equation once again I get the solutions: $$r(r-2\cos\theta)=0$$. Then $$p(\theta) = C|(2\cos\theta\sin\theta\cos\phi, 2\cos^2\theta, 2\cos\theta\sin\theta\sin\phi)|\sin\theta$$. After a few transformations: $$p(\theta) = 2C\cos\theta\sin\theta$$. Integrating $$\int_{0}^{2\pi}{d\phi}\int_{-\pi/2}^{\pi/2}{2C\cos\theta\sin\theta d\theta}$$ yields $$C = 1/2\pi$$. Ultimately I get $$p(\theta) = \frac{\cos\theta\sin\theta}{\pi}$$.

My proof seems to be incorrect as I didn't take into account the $$r$$ and $$r^2$$ factors when integrating, yielding $$C_1\cos^2\theta$$ and $$C_2\cos^3\theta$$ for the pdfs.