# Expressing a function as Heaviside function

I have a question: given a piecewise function, f(t)= {t when t<=0 ,0 when 0<t<=1, 1-t when t>1. How do express it as a Heaviside function?
I have tried to do the solution which is : f(t)= (1-t)*H(t-1)+t*H(t). Here I have considered two non-zero portions of f(t), which are t and 1-t. Is that right? Please let me know about my attempt.

vela
Staff Emeritus
Homework Helper