derivative of a sawtooth wave