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.  
 A: 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}$$
A: 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)$
A: 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}
$$
