binbagsss said:
Homework Statement
I have probabilty density ##\rho(\theta,\phi)=\frac{1}{4\pi} sin \theta d\theta d\phi##
The question is let ##\theta## be measured with respect to the z-axis, find the probability ##p_{z}(z) dz ## that the particle lies between ##z## and ##z+dz##?
Homework Equations
see above
The Attempt at a Solution
My method:
##z=cos \theta ##
##\frac{d\theta}{dz}= \frac{-1}{sin\theta}##
##\int^{2\pi}_{0} d\phi \int \frac{1}{4\pi} sin \theta dz . \frac{d\theta}{dz} ##
= ##2\pi \frac{-1}{4\pi} = - \frac{1}{2} ##
This is wrong by a minus sign and the solutions instead do:
##P_{z}(z)=...=p(\theta) |\frac{d\theta}{dz}|= 1/2##?
(the '...' being the integration over ##\phi##. )
MY QUESTION:
I don't understand where or why the modulus signs come from in the transformation variables : ##|\frac{d\theta}{dz}|##?
Many thanks
Before I start:
(1) the probability density is just ##\frac{1}{4\pi} \sin \theta##; it does not include ##d \theta## and ##d \phi##, which refer to
integration of the density.
(2) do not write ##sin \theta## and ##cos \theta##; they look ugly and are hard to read. Instead, write ##\sin \theta## and ##\cos \theta##, which you do by putting a "\" in front of the sin and cos (so write "\sin" instead of "sin", etc). That holds as well for all the other trig functions and things like "arcsin", etc., as well as for "exp", "log", "ln", "max", "min", "lim", and all the hyperbolic functions like "sinh", etc.
Rather than using canned formulas, I, personally, prefer to work first with the cumulative distribution, then differentiate it to get the density. So, if ##Z## is your ##z##-random variable, we have
$$F_Z(z) = P(Z \leq z) = P\{(\theta, \phi) : \cos \theta \leq z\} = \int_{\phi=0}^{2\pi} \int_{\theta=\arccos(z)}^{\pi} \rho(\theta,\phi)\, d \phi \, d \theta.$$
The ##\theta## limits go from ##\arccos(z)## to ##\pi## because we are looking at points on the sphere that lie below ##z##.
Now the probability density of ##Z## is ##f_Z(z) = dF_Z(z)/dz##, which is easily calculated using standard rules for differentiation of integrals with respect to their upper or lower limits.
The correct answer for the density function of ##Z## is, indeed, ##f_Z(z) = 1/2##; it should not have a ##dz## in it, because the ##dz## comes into play only when you integrate the density; it is not part of the density itself. See, eg.,
https://en.wikipedia.org/wiki/Probability_density_function or
https://onlinecourses.science.psu.edu/stat414/node/97 .