1 A graph to explain the derivation

2 Mathematical derivation

\[g(r)\Delta x\Delta y=p(x)\Delta x \:p(y)\Delta y \] \[g(r)=p(x)\:p(y)\] Differentiating wrt \(\theta\), we have \(0=p(y)\frac {dp} {dx}\frac {dx} {d\theta}+p(x)\frac {dp} {dy}\frac {dy} {d\theta}\) \(\;Furthermore\;x=r cos(\theta)\;and \;y=rsin(\theta)\) \(\therefore \frac{dx}{d\theta}=r(-sin(\theta))=-y \;and \;\frac{dy}{d\theta}=r(cos(\theta))=x\) \[0=p(y){p'(x)}(-y)+p(x)p'(y)x\Rightarrow \frac{p'(x)}{xp(x)}=\frac{p'(y)}{yp(y)}=C\] \[\frac{p'(x)}{xp(x)}=C \Rightarrow \frac{p'(x)}{p(x)}=Cx\] Integrating both sides, \[ln(p(x))=Cx^2/2+D \Rightarrow \;p(x)=e^{Cx^2/2+D}=Ae^{Cx^2/2}\] We know that p(x) decreases with the increase in x.Therefore, C must be negative. Let us assume C=-k \(\;where\; k>0.\therefore p(x)=Ae^{-kx^2/2}\) \[\int_{-\infty}^{+\infty}p(x)dx=1\Rightarrow \int_{-\infty}^{+\infty}Ae^{-kx^2/2}dx=1\] \[2A\int_{0}^{\infty}e^{-kx^2/2}dx=1\Rightarrow \int_{0}^{\infty}e^{-kx^2/2}dx=1/2A\] \[Similarly, \int_{0}^{\infty}e^{-ky^2/2}dy=1/2A\] \[\Rightarrow \left ( \int_{0}^{\infty}e^{-kx^2/2}dx \right )\left ( \int_{0}^{\infty}e^{-ky^2/2}dy \right )=(1/2A)^2=\frac{1}{4A^2}\] \[\int_{0}^{\infty}\int_{0}^{\infty}e^{-k(x^2+y^2)/2}dxdy=\frac{1}{4A^2}\]

Suppose \(x^2+y^2=r^2\), then \(dxdy=rdrd\theta\). Since the integral covers the first quadrant, \(\theta\) changes from 0 to \(\pi/2\) and r changes from 0 to \(\infty\). The integral becomes \(\int_{0}^{\pi/2}\int_{0}^{\infty}e^{-kr^2/2}rdrd\theta=\frac{1}{4A^2}\) Since \(\int e^{-kr^2/2}rdr=\frac{-1}{k}e^{-kr^2/2}\),the definite integral =1/k

\(\int_{0}^{\pi/2}{\frac {1}{k}d\theta}=\frac{\pi}{2k}=\frac{1}{4A^2}\)

After simplification, \(A= \sqrt {k/2\pi}\). We have, \(p(x)=Ae^{-kx^2/2}=\sqrt{k/2\pi}e^{-kx^2/2}.\)

\[Mean(X)=\int_{-\infty}^{\infty}xp(x)dx=\sqrt{k/2\pi}\int_{-\infty}^{\infty}xe^{-kx^2/2}dx\]

Since xp(x) is an odd function, the integral becomes zero suggesting that the mean is zero.

\[Var(X)=\sigma^2=\int_{-\infty}^{\infty}(x-\mu)^2p(x)dx=\sqrt{k/2\pi}\int_{-\infty}^{\infty}x^2e^{-kx^2/2}dx\] \[\sigma^2=\sqrt{k/2\pi}\int_{-\infty}^{\infty}x^2e^{-kx^2/2}dx=2\sqrt{k/2\pi}\int_{0}^{\infty}x(xe^{-kx^2/2})dx\]

Integrating by parts,

\[\int x(xe^{-kx^2/2})dx=x\int x(e^{-kx^2/2})dx-\int(dx/dx)\int x(e^{-kx^2/2})dx\] \[\int x(xe^{-kx^2/2})dx=x\int x(e^{-kx^2/2})dx-\int(dx/dx)\int x(e^{-kx^2/2})dx\] \[=x(\frac{e^{-kx^2/2}}{-k})-\int(\frac{e^{-kx^2/2}}{-k})dx=\frac{-x}{k}e^{-kx^2/2}+\frac{1}{k} \int e^{-kx^2/2}dx\]

When computing the definite integral, the first term becomes zero and the second term becomes \[\frac{1}{2Ak}\Rightarrow \sigma^2=2A\frac {1}{2kA}=1/k\] For standard normal distribution, \(\sigma^2\)=1. Therefore, k=1 and \(A=\frac{1}{\sqrt{2\pi}}\).

\[p(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}\]

2.1 Plot using basic R

2.2 Plot using ggplot package


  1. U of Universe, ↩︎