Given the PDF $$ f(x) = \begin{cases} 4x, & 0<x< \frac{1}{2} \\ 4-4x, & \frac{1}{2}<x\leqslant1 \\ 0, & \text{otherwise} \end{cases} $$
(A) Determine the cumulative distribution $F(x)$
(B) Determine $P(\frac{1}{3}< X \leqslant \frac{1}{2})$
I don't know how to do this, I know I have to either derive or integrate for A, but I don't know which of the two results to use to find X in B.