# show $\int_\mathbb{R} \frac{1}{\pi(1+x^2)}dx=1$

I am trying to show that density function of standard Cauchy distribution is well defined: that $$\int_\mathbb{R} \frac{1}{\pi(1+x^2)}dx=1.$$

I tried the following calculation: $$\int_{-N}^N \frac{1}{\pi(1+z^2)}dz=\int_{-N}^N\frac{i}{2\pi(z+i)}-\frac{i}{2\pi(z-i)}dz$$$$=\frac{i}{2\pi}\log(z+i)\biggr{|}_{-N}^N-\frac{i}{2\pi}\log(z-i)\biggr{|}_{-N}^N$$$$=\frac{i}{2\pi}(\log(N+i)-\log(-N+i))-\frac{i}{2\pi}(\log(N-i)-\log(-N-i))\to 0$$ as $$N\to \infty$$. The first equality is due to the fact that $$\frac{1}{z+i}-\frac{1}{z-i}=\frac{-2i}{z+1}.$$ The second equality is due to $$\frac{d\log z}{dz}=\frac{1}{z}$$ on a branch of $$\log z$$.

I know that I should get $$1$$ for $$\lim_{N\to\infty}\int_{-N}^N \frac{1}{\pi(1+z^2)}dz,$$ but I just couldn't find the mistake in the above calculation.

Where did I make the mistake? Also, how to calculate this integral if one doesn't do it this way?

Edit: following Oliver's comment, I found that I mis-calculated the limit $$\lim_{N\to\infty} \frac{i}{2\pi}(\log(N+i)-\log(-N+i))-\frac{i}{2\pi}(\log(N-i)-\log(-N-i)).$$ Here I am using the principal branch of logarithm, where $$\log$$ is given by $$\log z=\log r+i\theta$$. So, the limit should be exactly 1.

• The integrand has a well known antiderivative which you can find in any table. Knowing the antiderivative can give you intuition on what kind of substitution to try. May 21 at 23:00
• You are using incorrect branches of logarithm. In any case, this integral can be done by recalling that $D_x \arctan(x)=\frac{1}{1+x^2}$ May 22 at 0:16
• Thank you Oliver for pointing out the mistake, guess I didn't understand branches of logarithms that well. Also, thanks Ninad. May 22 at 0:56

Since $${d\over dx}(\tan^{-1}{x})={1\over 1+x^2}$$ then we have:
$$\int_\mathbb{R}{1\over\pi(1+x^2)}dx=\lim_{N\rightarrow\infty}{1\over \pi}\int_{-N}^{N}{1\over 1+x^2}dx={1\over \pi}\lim_{N\rightarrow\infty}[\tan^{-1}N-\tan^{-1}(-N)]$$ $$={1\over \pi}\lim_{N\rightarrow\infty}[\tan^{-1}N+\tan^{-1}(N)]={2\over \pi}\lim_{N\rightarrow\infty}\tan^{-1}(N)={2\over\pi}\cdot{\pi\over 2}=1$$
• A small nitpick. The double sided improper integral is defined when both the limits $\displaystyle\lim_{M \to\infty}\int_{0}^{M}\frac{1}{\pi(1+x^{2})}\,dx$ and $\displaystyle\lim_{N\to\infty}\int_{-N}^{0}\frac{1}{\pi(1+x^{2})}\,dx$ exists finitely and you define $\int_{-\infty}^{\infty}\frac{1}{\pi(1+x^{2})}\,dx$ as their sum. If the integral exists then we can write it as $\displaystyle \lim_{N\to\infty} \int_{-N}^{N}$ May 22 at 7:36
• The integrated function is positive, so $\int\limits_{-N}^N$ is fine. May 24 at 14:22