[Math] Differentiating a Triangle Wave function

derivativesordinary differential equations

Okay this might be a fairly trivial question but I'm a little unsure how to approach it. I'd like to differentiate a triangle wave, as defined in the article: https://en.wikipedia.org/wiki/Triangle_wave

Note that I don't want to work with the Fourier equation or the Trigonometric equation versions of the Triangle Wave, but instead I would rather work with an equation which does not have any trigonometric functions if possible. For example, the wikipedia article listed above has an equation such as:

$x(t) = 2 \left| 2 \left( \frac{t}{a} – \left \lfloor{\frac{t}{a} + \frac{1}{2}}\right \rfloor \right) \right|$

where I take $a = 1$. The problem however is that I don't know how to differentiate functions such as "floor" or "mod"… is such a thing even possible? If not, are there any other equations for the Triangle Wave which do not have any trigonometric terms in it but which can be differentiated?

Thanks!

EDIT: Okay so as stupid as this might be, it honestly didn't occur to me to read up on the square wave function (which is the derivative of the triangle wave), so I guess my question has been more or less answered. Out of curiosities sake however, I am interested in finding out how this is derived, especially since users below mentioned how the floor function has either derivative $0$ or has no derivative. If that's the case, how do we differentiate the triangle wave to obtain the square wave?

Best Answer

Hint: The floor function is flat between integers, and has a jump at each integer; so its derivative is zero everywhere it exists, and does not exist at integers.

The mod function coincides with identity between $0$ and the divisor; so its derivative is $1$ everywhere it exists, and does not exist at integral multiples of the divisor.