Piecewise[{{x/40*3+1, 0 < x < 40}, {4+(x-40)/(80-40)*(6-4), 40 < x < 80}, {6, 80<x<100}}]