Why does $\int_{-\infty}^{\infty} |x-b|f(x)dx=\int_{-\infty}^b(b-x)f(x)dx+\int_{b}^{\infty}(x-b)f(x)dx$?

58 Views Asked by At

I am working on the following problem:

Let $X$ be a random variable of the continuous type that has pdf $f(x)$. If $m$ is the unique median of the distribution of $X$ and $b$ is a real constant, show that $$E(|X-b|)=E(|X-m|)+2\int_{m}^{b} (b-x)f(x)dx,$$ provided that the expectations exist.

Since $X$ has a pdf of $f(x)$, I know that the expectation of $E(|x-b|)$ is defined as $$E(|x-b|)=\int_{-\infty}^\infty |x-b|f(x)dx.$$ Where I'm getting stuck is the step that immediately follows this. Specifically, the solution provided shows:

$$\int_{-\infty}^\infty |x-b|f(x)dx=\int_{-\infty}^b(b-x)f(x)dx+\int_{b}^\infty (x-b)f(x)dx.$$ What is happening in this step?

1

There are 1 best solutions below

3
On BEST ANSWER

They are splitting up the integral into two integrals corresponding to the two cases:

  1. If $x \le b$, $|x-b| = b-x$.
  2. If $x > b$, $|x-b| = x-b$.