# CDF to PDF - Piecewise

Consider a random variable $X$ having the following PDF $$f(x)=\begin{cases}c,&\text{for }0<x<2\\2c,&\text{for }5<x<10\\0,&\text{otherwise}\end{cases}$$

$$2<x<5\\[5pt]\int_0^2\frac1{12}\ \mathrm dt+\int_2^x\frac16\ \mathrm dt=\frac x6-\frac16$$

We have to find the CDF of the piece-wise function. I get every part of the conversion right but when I got to finding $2<x<5$, the answer was $\frac16$ and I got something different. Can someone tell me what I'm doing wrong?

• The variable has $0$ probability of being between $2$ and $5$. – lulu May 29 '16 at 0:07
• Ah okay.. so would I plug in 0 for x? But then how come I got -1/6 ? The answer is + 1/6. – NookLines May 29 '16 at 0:08
• To adapt your formula, the answer would be $\int_0^2 \frac 1{12}dt+\int_2^x 0\,dt=\frac 2{12}+0=\frac 16$. – lulu May 29 '16 at 0:10
• ohhhh!! I see, thank you so much! – NookLines May 29 '16 at 0:14
• The title looks opposite of the body. – barak manos May 29 '16 at 12:01