How Do You Differentiate a Triangle Wave?
At a glance
- 1. Set the convention
Identify the wave’s amplitude, period, and starting point; these determine the slopes of its linear segments.
- 2. Differentiate each segment
The derivative on each straight segment is its constant slope, positive while rising and negative while falling.
- 3. Check the corners
Compare the left- and right-hand slopes at every peak and trough; if they differ, the derivative does not exist there.
- 4. Check the units
The derivative’s units are amplitude units divided by time, such as volts per second.
A triangle wave is piecewise linear, so differentiating it means finding the slope of each rising or falling segment. The result is a square wave: a constant positive value while the triangle rises and a constant negative value while it falls.
The derivative is not defined at the triangle wave’s sharp corners. At a peak or trough, the slope changes abruptly, so the left-hand and right-hand derivatives disagree.
A standard triangle-wave definition
Suppose the wave ranges from to and repeats every seconds. Here, is the peak amplitude, and is the period. Let be the time within one period, with . One standard definition is
During the first half of the period, the wave rises from to . During the second half, it falls back to . Each half lasts , and each change in height has magnitude , so the slope magnitude is
Differentiating the two linear pieces gives
The derivative is undefined when or , which are the trough and peak. The endpoints are excluded because they are corners, not because the wave itself is discontinuous: the triangle wave is continuous there.
Worked example
Consider a voltage triangle wave that rises from to in , then falls back to in the next . Its period is and its amplitude is . The rising slope is
Therefore, the derivative is during each rising segment and during each falling segment. It is undefined at each maximum and minimum. The positive and negative signs indicate direction of change; the derivative’s units are volts per second.
Why the corners have no derivative
At a peak, the wave approaches along a rising segment and leaves along a falling segment. In the standard definition, the left-hand slope is and the right-hand slope is . A derivative exists only if these one-sided slopes agree, so there is no derivative at the peak. At a trough, the slopes switch from negative to positive, and the same issue occurs.
This is the ordinary, point-by-point derivative. In idealized signal analysis, a triangle wave’s derivative is often described as a square wave. That description refers to the constant slopes between corners; it does not make the derivative defined at the corners themselves.
Different amplitude and phase conventions
The factor in the derivative depends on what a source calls the amplitude. If a wave ranges from to instead of from to , the height change over each half-period is . Its slope magnitude is then . In this convention, is the full peak-to-peak height, not the peak amplitude about a zero midpoint.
A time shift or a vertical offset changes where the corners occur or where the wave is centered, but it does not change the slope magnitudes. For a shifted wave, locate the shifted peaks and troughs, then use the same rising and falling slopes. If frequency is given instead of period, use ; for the range to , the slope magnitude is .
Common mistakes
- Differentiating the wave as if it were a sine wave: A triangle wave is linear between corners, so its derivative is constant on each segment, not sinusoidal.
- Forgetting the amplitude convention: A range of to has total height ; a range of to has total height . The corresponding slope magnitudes differ by a factor of two if the same letter is used for both quantities.
- Assigning a derivative at a corner: The derivative is undefined at each sharp peak and trough. A plotting or simulation program may assign a value there, but that is a chosen convention, not the classical derivative.
- Ignoring units: If time is measured in milliseconds, the direct slope calculation gives amplitude per millisecond. Convert to seconds only if the application needs those units.
Connection to Fourier series
A triangle wave can also be represented by a Fourier series. Differentiating its series produces the Fourier series of a square wave: away from the corners, it agrees with the triangle wave’s constant positive or negative slope. At a jump in that square wave, the Fourier series converges to the average of the two one-sided limits. For a symmetric square wave, that average is zero, but the triangle wave still has no classical derivative at the corner.
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.