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.

Let's put it this way
$$\int_{-\infty}^Y f(x)=
\begin{cases}
0 & -\infty < Y < -3 \\ 
Y^2+3Y+{9\over 2} & -3\le Y <-2 \\
{1\over 2} & -2\le Y <2 \\
{1\over 2} +\int_2^Y(3-x)\, dx & 2\le Y < 3 \\
1 & Y\ge 3
\end{cases}$$
The first term is INDEED including the 9/2, this is because it is
$$\int_{-3}^Y f(x)\,dx\int_{-3}^Y (x+3)\,dx$$
By the fundamental theorem of calculus, this is the antiderivative at the top limit, Y, minus the antiderivative at the bottom limit, -3. The value of $x^2/2+3x$ at $x=-3$ is $-9/2$ so you get the result with the +9/2 because you subtract the bottom limit and subtracting a negative gives a positive.
