In my probability/stats course, they have defined a probability density function as:

$$f(x) = |x|\quad,\quad -1 < x < 1$$

I am having difficulty with how they have integrated this to find the cumulative distribution function:

$F(x) = (1-x^2)/2, \quad -1 \leq x \leq 0$, and

$F(x) = (1+x^2)/2, \quad 0 \leq x \leq 1$.