# Get c.d.f. from given p.d.f.

The p.d.f. for $X$ is: $$f_X(x) = \begin{cases} \frac{1}{18}(x+3) & -3 < x < 0 \\ \frac{1}{54}(9-x) & 0\leq x < 9 \\ 0 & otherwise \end{cases}$$

I found the c.d.f. piecewise after integrating to be: $$F_X(x)=\begin{cases} \frac{1}{18}(\frac{x^2}{2}+3x) & -3 < x < 0 \\ \frac{1}{54}(9x-\frac{x^2}{2}) & 0\leq x < 9 \\ \end{cases}$$

I'm told to graph both of these (which I found $f_X$ to be .25 and .75 for the piecewise functions, respectively), but I'm sure most will see the issue where the c.d.f. graph will give negative values for -3 < x < 0. Is that possible? I was under the impression it couldn't be negative for any value in $F_X$? Am I missing a step?

• You forgot the $+C$ while integrating -- you know the CDF is zero at $-3$. – Batman Nov 6 '15 at 21:35

For $-3<x<0$ your CDF should actually be
$$F(x)=\int_{-3}^x \frac{1}{18} (y+3) dy.$$
Similarly, for $0<x<9$ you should have
$$F(x)=F(0)+\int_0^x \frac{1}{54} (9-y) dy.$$