f = F '

C = 0 (slider from -10 to 10, step 0.1)
f2(x) = x - 2 + C
f3(x) = (-2 * x) + 16 + C
f1(x) = 4 - x + C
F(x) = If[x  <  3, f1, 3 ≤ x < 6, f2, f3]
f1'(x) = f1'(x)
f2'(x) = f2'(x)
f3'(x) = f3'(x)
f(x) = If[x  <  3, f1'(x), 3 ≤ x < 6, f2'(x), f3'(x)]