<s>[INST] Producing a CDF from a given PDF So I have this PDF: 
$$
f(x)=
\begin{cases}
x + 3 & \text{ for } -3 \leq x < -2\\ 
3 - x & \text{ for }  2 \leq x < 3\\
0 & \text{ otherwise}
\end{cases}
$$
To make this a CDF, I have integrated the PDF from $-\infty$ to some value, $x$.
$$
F(x)= 
\begin{cases}
\frac{x^2}{2} + 3x + \frac{9}{2} & \text{ for } -3 \leq x <-2\\
 \frac{1}{2} & \text{ for } -2 \leq x<2\\
\frac{-x^2}{2} + 3x + \frac{7}{2} & \text{ for } 2 \leq x<3
\end{cases}
$$
My friend argues that the first term in this CDF which is $(x^2/2 + 3x + 9/2)$ should actually be $(x^2/2 + 3x)$. But isn't this impossible? At $x = -3$, the CDF must be $0$, am I correct?. This is only true in the case where the first term is $(x^2/2 + 3x + 9/2)$.
If someone could shed light on this topic, that would be much appreciated.
 [/INST] Note first of all that the cdf is defined for all $x$, so a complete answer should take care of all $x$.
If $x\lt -3$, everything is easy. We have $\int_{-\infty}^x f_X(t)\,dt=0$. So $F_X(x)=0$ if $x\lt -3$. 
Now for $-3\le x\lt -2$, in effect we are integrating $t+3$ from $-3$ to $x$, since there is no "mass" before $-3$.  An antiderivative is $t^2/2+3t$. Plug in. We get $\frac{x^2}{2}+3x+\frac{9}{2}$. 
Note that this is $\frac{1}{2}$ at $x=-2$. The density function is then $0$ for a while, so exactly as you had it, if $-2\le x\lt 2$ then $F_X(x)=\frac{1}{2}$.
Now for $2\le x\lt 3$, we want the integral up to $2$, plus the integral from $2$ to $x$ of $3-t$. We get 
$$\frac{1}{2}+(3x-\frac{x^2}{2})- 4.$$
Finally, for $x\ge 3$, the cdf is $1$. 
</s>