Answer
$14\ \text{units}$
Work Step by Step
The mass can be calculated as:
$Mass, M=\int_0^6 \rho(x) \ dx=\int_0^2 1 \ dx+\int_2^4 2 \ dx+\int_4^6 4 \ dx$
or, $=[x]_0^2+[2x]_2^4+[4x]_4^6$
or, $=2+2(4-2)+4(6-4)$
or, $=14\ \text{units}$