# Converting a probability function from Polar coordinates to Cartesian coordinates

I am confused about converting a Probability Density Function from Polar coordinates to Cartesian coordinates.

Here is an example:

In Polar coordinates, we can have a Gaussian probability function:

$$P(r,\theta)=Ae^{-r^2/2\sigma^2}$$ according to the transformation: $$r^2=x^2+y^2 \textrm{ and } \theta=\tan^{-1}(y/x)$$.

This function in Cartesian coordinates should also be a Gaussian function:

$$P(x,y)=Ae^{-(x^2+y^2)/2\sigma^2}$$

But somebody told me that in this transformation, I should multiply by the absolute value of the Jacobian determinate in order to have:

$$P(x,y)=Ae^{-(x^2+y^2)/2\sigma^2}/\sqrt{x^2+y^2}$$

And the result is not Gaussian anymore!

Could someone tell me which one is correct and also the reason, please?

## 2 Answers

UPDATE

If your function in polar coordinates is a circularly symmetric Gaussian centered at the origin, then it could be written $$P_{r\, \theta}(r,\theta)=A\,r\,e^{-r^2/2\sigma^2}$$ and you can obtain $$A$$ from

$$\int_0^{2\pi} \int_0^\infty P_{r\, \theta}(r,\theta) \,dr\, d\theta = 1.$$

Integration yields: $$\displaystyle A = \frac{1}{2 \pi \sigma^2}$$.

The Jacobian of the transformation is $$J(x,y)=\begin{vmatrix}\cos \theta& -r \sin \theta \\ \sin \theta &r\cos \theta \end{vmatrix}={r}.$$ so that (see text referenced in the comments below)

$$P_{x\, y}(x,y)= \frac{P_{r,\,\theta}(r,\theta)}{|J(x,y)|}=\frac{1}{r}P_{r,\, \theta}\left(\sqrt{x^2+y^2},\tan^{-1} \frac{y}{x}\right).$$

Thus $$\displaystyle P_{x\, y}(x,y) = \frac{1}{2\pi \sigma^2} e^\frac{-(x^2 + y^2)}{2\sigma^2}.$$

• Thank you. But why the integration of $P(r,\theta)$ cannot be $\int^{2\pi}_0 \int^\infty_{-\infty} P(r,\theta)drd\theta$? – JIN TLG Apr 10 at 17:36
• If you had a piece of graph paper in Cartesian coordinates, each square would have equal area. Now produce a "polar piece of graph paper": Draw concentric circles at radii 1,2,3, ... Now starting at origin, draw uniformly spaced rays, say spaced at 10 degrees, for example. The sectors closer to the origin are smaller in area, the sectors near circles with larger radii are larger. The scaling factor is exactly "r" and this is the "multiplication factor" needed to integrate a function over some region of space, or all space. – mjw Apr 10 at 18:32
• if you look at the answer in this link: math.stackexchange.com/questions/1932170/…. They added the Jacobin term in the converting process. – JIN TLG Apr 10 at 18:54
• You are right! That is the convention (at least in the textbook I just looked in!). – mjw Apr 10 at 19:37
• In a calculus class, we would (usually) apply the Jacobian to the differential. Seems that the probability convention (Papoulis), is to transform the probability density function itself. – mjw Apr 10 at 19:39

Your transformation takes a PDF in $$r$$ and converts it into a Joint Density Function in $${x,y}$$. So what you really need to do is preserve the normalising property i.e.,

$$\int_{x=-\infty}^{x=\infty} \int_{y=-\infty}^{y=\infty} P(x,y)dxdy =1$$

See if you can take it from here.

• For integrate the $P(r,\theta)$, I should use $rdrd\theta$ or $drd\theta$? – JIN TLG Apr 10 at 16:14
• Your PDF is axi-symmetric and so independent of $\theta$. You'd have to work out the double integral in $x$ and $y$, not $r$. The parameter $A$ is presumably defined such that the PDF in $r$ is properly normalised. – Sharat V Chandrasekhar Apr 10 at 16:30
• You would also need to express $\sigma$ which is really $\sigma_r$ (the standard deviation of the radial location) in terms of $\sigma_x$ and $\sigma_y$ from the transformation rule. – Sharat V Chandrasekhar Apr 10 at 16:33