Chaitanya's Random Pages

July 31, 2012

Another integral independent of a parameter

Filed under: mathematics — ckrao @ 10:25 am

Over at math.stackexchange I found an integral very similar to one I had blogged about earlier.

In this post I will show that the following integral holds.

\displaystyle \int_0^{\infty} \frac{x^2}{x^2 + (x^2 - a)^2}\ dx = \int_0^{\infty} \frac{1}{1 + \left(x - a/x\right)^2}\ dx = \frac{\pi}{2}, \quad \text{Re}(a) > 0.

In other words, the value does not depend on a. This looks similar to this integral based on the Gaussian:

\displaystyle \int_0^{\infty} \exp \left(-(x-a/x)^2 \right)\ dx = \int_0^{\infty} \exp \left(-x^2 \right)\ dx = \frac{\sqrt{\pi}}{2}, \quad \text{Re}(a) > 0.

The solution for the second integral is given here.

We prove it through similar means. Denote the left side as f(a) (a continuous function of a) and differentiate under the integral sign.

\begin{array}{lcl} \frac{df}{da} &=& \frac{d}{da} \int_0^{\infty} \frac{1}{1+ (x-a/x)^2 }\ dx \\&=& \int_0^{\infty} \frac{\partial}{\partial a} \frac{1}{1+ (x-a/x)^2}\ dx\\&=& \int_0^{\infty} \frac{1}{\left[1+ (x-a/x)^2 \right]^2} \left( 2-\frac{2a}{x^2}\right) \ dx. \end{array}

The interchange of integral and derivative is valid here as the integrand and its derivative are continuous in the open interval of interest, plus the integral exists. Next, note that if we make the substitution u = a/x then dx = -a/u^2\ du and

\begin{array}{lcl} \frac{1}{2} \frac{df}{da} &=& \int_0^{\infty} \frac{1}{\left[1 + (x-a/x)^2 \right]^2} \left(1 - \frac{a}{x^2} \right)\ dx \\& = & \int_0^{\infty} \frac{1}{\left[1 + (x-a/x)^2 \right]^2}\ dx - \int_0^{\infty} \frac{1}{\left[1 + (x-a/x)^2 \right]^2}. \frac{a}{x^2}\ dx\\&=& \int_0^{\infty} \frac{1}{\left[1 + (x-a/x)^2 \right]^2}\ dx - \int_{\infty}^0 \frac{1}{\left[1 + (a/u-u)^2 \right]^2} \ (-du)\\& =& \int_0^{\infty} \frac{1}{\left[1 + (x-a/x)^2 \right]^2}\ dx - \int_0^{\infty} \frac{1}{\left[1 + (a/u-u)^2 \right]^2} \ du\\&=& 0 \end{array}

(Note that this is not valid when \text{Re}(a) \leq 0.)

It follows that the integral is independent of a in the region where it is differentiable as a function of a. Hence it is equal to its constant value in the limit \text{Re}(a) \rightarrow 0+, which is

\displaystyle \int_0^{\infty} \frac{1}{1+ x^2}\ dx = \left[\arctan x\right]_0^{\infty} = \frac{\pi}{2},

as we wished to show.

The same idea can be applied to general integrals of the form \displaystyle \int_0^{\infty} g((x-a/x)^2)\ dx, where g(x) is any differentiable function so that the integral exists. We have seen the integral is independent of a for \text{Re}(a) > 0 when g(x) = \exp(-x) and g(x) = 1/(1+x).

\displaystyle \int_0^{\infty} g((x-a/x)^2)\ dx = \int_0^{\infty} g(x^2)\ dx, \text{Re}(a) \leq 0.

It seems remarkable to me that the transformation x \rightarrow |x - a/x| for any a with positive real part somehow preserves the area under the curve of g(x^2) for positive x. 🙂

July 30, 2012

Sangakkara’s recent form in test cricket

Filed under: cricket,sport — ckrao @ 9:13 am

In his last 51 test matches (89 innings) from the start of July 2006 to the end of July 2012, Kumar Sangakkara has scored 5416 runs at 68.55 with 21 centuries and 17 half-centuries (next highest average over this period is Chanderpaul with 63.71 – source here).  Only Bradman, Ponting, Sobers and Kallis have had a higher average over a similar number of tests (ref). These 51 tests have included 5 200+ scores and 3 more in the 190s (two of which were in the recently-concluded series against Pakistan). The first 9 of these tests (right after giving up the gloves to focus on batsmanship) were one of the greatest purple patches in test history with1529 runs @152.9 in 14 innings including 7 100s and 2 50s. He has still averaged an impressive 56.33 since then.

A few more facts about his test career follow:

  • Over his career he has now scored 9872 runs in 189 innings, even more than Lara (9830),  Ponting (9570) and Tendulkar (9543).
  • He has scored more runs and centuries against Pakistan than anyone else: 2320 runs @ 89.23 with 9 100s and 8 50s. His series-by-series averages against them are: 244 (1-off test), 53, 72, 79.67, 66.2, 86 and 163.33 (ref)!
  • As a non-keeper he still averages a whopping 69.63 over 63 tests with 23 100s and 28 50s.
  • There is an interesting contrast in his records in England, India, West Indies and South Africa compared with everywhere else (ref)
Tests Innings Not Outs Runs Highest Score Average 100s 50s
Sangakarra in England, South Africa, India, West Indies 27 51 1 1695 137 33.90 3 8
Sangakarra in Sri Lanka 63 101 11 5676 287 63.06 18 20
Sangakkara everywhere else 21 37 3 2501 270 73.56 9 11


One of my favourite innings I have seen from him (or indeed anyone) is this effort in Hobart.

July 18, 2012

The mean of a random variable in terms of its cdf

Filed under: mathematics — ckrao @ 9:17 pm

One of the nice applications of Fubini’s theorem is the following result that a random variable’s mean may be found from its cumulative distribution function (cdf) directly.

If X is a random variable with cdf F(x) = {\rm Pr}(X \leq x) then its mean (expected value) E[X] is given by

\displaystyle E[X] = \int_0^{\infty} \left(1 - F(x)\right)\ dx - \int_{-\infty}^0 F(x)\ dx,

provided at least one of the two integrals is finite. This formula may be interpreted as the area of the region above the graph of F(x) and below y=1 for positive x minus the area of the region below the graph of F(x) (and above the x axis) for negative x. It also becomes intuitive by considering the Lebesgue-Stieltjes integral E[X] = \int_{-\infty}^{\infty} x \ dF(x), in which the y=F(x) axis is subdivided.

To show this we first decompose X into difference of its positive and negative parts: X = X^+ - X^-, where X^+ = \max\{X,0\} and X^- = \max\{-X,0\}. Then we may write each of these in terms of integrals of the following 0-1 indicator random variables (equal to 1 if the inequality holds, 0 otherwise).

\displaystyle X^+ = \int_0^{\infty} I\{X > t\}\ dt
\displaystyle X^- = \int_{-\infty}^0 I\{t \geq X\}\ dt

Applying Fubini’s theorem on the positive functions I\{X > t\} and I\{t \geq X\} we swap integration and expectation and then use the fact that the expectation of an indicator random variable is the probability of the corresponding event occurring. We obtain

\begin{array}{lcl} E[X] & = & E\left[X^+ - X^-\right]\\& = & E\left[ X^+\right] - E\left[X^- \right] \\& = & E\left[ \int_0^{\infty} I\{X > t\}\ dt \right] - E\left[\int_{-\infty}^0 I\{t \geq X\}\ dt \right]\\& = & \int_0^{\infty} E[I\{X > t\}]\ dt - \int_{-\infty}^0 E[I\{t \geq X\}]\ dt \\ & = & \int_0^{\infty} {\rm Pr}(X > t)\ dt - \int_0^{\infty} {\rm Pr}(X \leq t)\ dt\\ & = & \int_0^{\infty} \left(1 - F(t)\right)\ dt - \int_{-\infty}^0 F(t)\ dt,\end{array}

as required. The result may also be proved by integration by parts [1].


[1] Hajek, Notes for ECE 534: An Exploration of Random Processes for Engineers, July 2011, available here.

Create a free website or blog at

%d bloggers like this: