First there is an ambiguity in how the Heaviside step is defined at the jump. if you are working with the definition you can't match the function at the jumps. I'm not geing to worry about the definition at the jumps and assume the definition of that you have is OK for this function.

The jumps are at and , so:

That is the first term on the right is the function definition on extended to the whole of , the second term is is zero for and for subtracts the first term to get rid of it where we dont need it and adds in the function on the diddle segment of the domain.

The third term removes the middle function and adds in the right most part of the function for

RonL