
Douglas B. answered 08/04/20
Differential equations tutor (former TA with masters in applied math)
First of all, we 'turn on' the function x by simply writing f(x) = x + ...
Next, we turn off the function x at x = 1/2 by subtracting xH(x-1/2). So far, f(x) = x-xH(x-1/2)+...
Next, we turn on the function 1-x at x = 1/2 by adding (1-x)H(x-1/2). Now, f(x) = x-xH(x-1/2)+(1-x)H(x-1/2)+...
Finally, we turn off the function 1-x at x = 1 by subtracting (1-x)H(x-1). Thus,
f(x) = x-xH(x-1/2)+(1-x)H(x-1/2)-(1-x)H(x-1). Collecting like terms,
f(x) = x+(1-2x)H(x-1/2)-(1-x)H(x-1).