Cumulative distribution function, integration problem

Given the continuous Probability density function $f(x)=\begin{cases} 2x-4, & 2\le x\le3 \\ 0 ,& \text{else}\end{cases}$

Find the cumulative distribution function $F(x)$.

The formula is $F(x)=\int _{ -\infty }^{ x }{ f(x) }$

My Solution

The first case is when $2\le x\le3$ then $$\int_2^x {(2u-4)} \, du=[u^2-4u]_2^x=x^2-4x-4+8=x^2-4x+4$$

so $F(x)=x^2-4x+4 , \text{ for } 2\le x\le 3$

The Problem

Now I have the cases where $x<2 \text{ and } x>3$ , ($\int_{-\infty}^{x}0 \, dx$) but I am not sure how to do it. I would appreciate if someone could show me the solution of this two cases.

In the ranges $x < 2$ and $x>3$ the PDF is zero and contibutes nothing to the integral, and therefore the CDF is constant in these ranges. You have already done most of the work and the CDF is $$F(x)=\begin{cases} 0, & x < 2 \\ x^2-4x+4, & 2 \le x\le3 \\ 1 ,& x > 3 \end{cases}$$

• could you please explain the case $x>3$ why is it 1 ? Sep 2, 2013 at 13:21
• As I already said, the PDF is zero for $x>3$ and therefor the value is $F(x) = F(3) = 1, \quad x > 3, \quad$ because $\int_{3}^{x}0dt = 0.$ Sep 2, 2013 at 13:23

when x<2, it is $\int_{-\infty}^{x}0du=0$

when x>3, it is obviously 1. You should research the properties of $F(x)$

• could you please explain a bit more the case $x>3$ why is it 1 ? Sep 2, 2013 at 13:21
• $F(x)$ is increasing and $lim F(x)=1$ for $x-->infinity$ Sep 2, 2013 at 13:29
• Oh, thanks now I get it. This is actually one of the three characteristic of continuous CDF. Sep 2, 2013 at 13:32
• @Devid: Another way to see why $F(x)=1$ for $x>3$ is to split up the integral as follows: If $x>3$, then \begin{align} F(x)&=\int_{-\infty}^2 f(x)\,\mathrm dx+\int_2^3 f(x)\,\mathrm dx+\int_3^x f(x)\,\mathrm dx\\ &=\int_{-\infty}^2 0\,\mathrm dx+\int_2^3 (2x-4)\,\mathrm dx+\int_3^x 0\,\mathrm dx=0+1+0=1 \end{align} Sep 2, 2013 at 14:38
• @StefanHansen thanks very much this was very helpful. I think actually this is the best solution. If you posted it as answer i would accept. Sep 2, 2013 at 15:08

A general technique to deal with such type of questions is to split up the integral at the points where the density $f$ has different specifications, i.e. at $y=2$ and $y=3$. If $y<2$, then $$F(y)=\int_{-\infty}^yf(x)\,\mathrm dx=\int_{-\infty}^y0\,\mathrm dx=0,$$ and if $2\leq y\leq 3$, then \begin{align} F(y)&=\int_{-\infty}^2f(x)\,\mathrm dx+\int_2^yf(x)\,\mathrm dx=\int_{-\infty}^20\,\mathrm dx+\int_2^y(2x-4)\,\mathrm dx\\ &=0+\left[x^2-4x\right]_2^y=y^2-4y+4. \end{align} Lastly, if $y>3$ then \begin{align} F(y)&=\int_{-\infty}^2 f(x)\,\mathrm dx+\int_2^3 f(x)\,\mathrm dx+\int_3^y f(x)\,\mathrm dx\\ &=\int_{-\infty}^2 0\,\mathrm dx+\int_2^3 (2x-4)\,\mathrm dx+\int_3^y 0\,\mathrm dx\\ &=0+1+0=1. \end{align}