Sawtooth and Triangle Waves
FS07 built a complete Fourier series for the square wave. We now apply the same coefficient
machinery to two piecewise-linear waveforms: the sawtooth wave and the triangle wave.
These two examples are especially valuable because their shapes look similarly simple in the time
or spatial domain, but their harmonic spectra decay at different rates.
- The sawtooth wave has a jump discontinuity in the waveform itself.
- The triangle wave is continuous, but its slope changes abruptly at its corners.
- The sawtooth Fourier coefficients decrease like 1∕n.
- The triangle-wave Fourier coefficients decrease like 1∕n2.
That contrast gives our first concrete connection between waveform smoothness and spectral
decay.
We begin on [−π,π], then generalize both results to [−L,L] and to time-periodic signals.
1 Two piecewise-linear periodic waveforms
Let A > 0.
Define the odd sawtooth wave on one reference interval by
with periodic extension
As x approaches π from the left, the value approaches +A. Immediately after the period resets, the
periodic extension returns to values near −A. Thus the sawtooth has a jump of height 2A at every
odd multiple of π.
Now define the centered triangle wave by
and extend it periodically with period 2π.
The triangle wave satisfies
Unlike the sawtooth, it is continuous across the period boundary. Its corners occur where the slope
changes abruptly.
Figure 1. The odd sawtooth is piecewise linear but jumps at the period boundary. The centered
triangle wave is continuous but has corners where its slope changes.
2 Inspect symmetry before integrating
The sawtooth satisfies
so it is odd. Therefore
and its Fourier series contains only sine terms.
The triangle wave satisfies
so it is even. Therefore
and its Fourier series contains only a constant term and cosine terms.
A second symmetry appears for the triangle wave. Its periodic extension obeys
This is half-wave antisymmetry. It will eliminate every even harmonic.
Figure 2. Symmetry predicts large parts of each Fourier series before any coefficient integral is
evaluated.
3 Derive the sawtooth coefficients
Since the sawtooth is odd, start with the sine coefficient formula
Substitute
Then
| bn | = ∫
−ππx sin(nx) dx. | (12) |
The product x sin(nx) is even, so
Use integration by parts. Let
Then
Therefore
| ∫
0πx sin(nx) dx | = 0π + ∫
0π cos(nx) dx. | (16) |
The remaining integral is
The boundary term gives
Hence
Substituting into Eq. (13) gives
Thus the complete sawtooth Fourier series is
Writing the first few terms explicitly,
Two features are immediately visible:
- every positive integer harmonic appears,
- and the coefficient magnitude decreases like 1∕n.
4 The sawtooth harmonic spectrum
The magnitude of the nth sine coefficient is
So the first few normalized magnitudes are
 | = ≈ 0.63662, | (24)
|
 | = ≈ 0.31831, | (25)
|
 | = ≈ 0.21221, | (26)
|
 | = ≈ 0.15915. | (27) |
The signs alternate, but the envelope is proportional to 1∕n.
Figure 3. The sawtooth contains every sine harmonic. The coefficient signs alternate, while the
magnitude envelope decreases as 1∕n.
5 Sawtooth partial sums and the period-boundary jump
Define the N-harmonic sawtooth partial sum by
Every finite partial sum is continuous because it is a finite sum of continuous sine functions. The
target periodic sawtooth, however, jumps at x = ±π.
This creates the same basic convergence tension that appeared for the square wave in FS07. As
more harmonics are added,
- the straight-line interior is reproduced more accurately,
- the transition near the periodic jump becomes narrower,
- and oscillatory ringing remains near the jump.
The detailed limiting analysis belongs to FS14 through FS16.
Figure 4. Sawtooth partial sums using N = 1, 5, and 20 harmonics. More harmonics improve the
interior linear ramp while concentrating oscillatory behavior near the jump.
At the jump point itself, the left and right limiting values are
Their midpoint is
The later convergence articles will show why the Fourier series approaches this midpoint at the
jump.
6 Derive the triangle-wave constant coefficient
Now turn to
Because t(x) is even,
Evaluate the two parts:
Thus the triangle wave has zero mean.
This agrees with its geometry: positive and negative triangular areas cancel over one full
period.
7 Derive the triangle-wave cosine coefficients
Since the waveform is even,
Substitute the positive-half expression
Then
| an | = ∫
0π cos(nx) dx | |
|
| =  . | (36) |
The first integral vanishes:
For the second integral, use integration by parts. Let
Then
Hence
| ∫
0πx cos(nx) dx | = 0π − ∫
0π sin(nx) dx. | (40) |
The boundary term is zero because sin(nπ) = 0. The remaining integral is
| ∫
0π sin(nx) dx | = 0π | |
|
| = . | (41) |
Therefore
Substitute this into Eq. (36):
Thus
The triangle-wave Fourier series is therefore
with convergence qualifications to be formalized later.
The first terms are
Figure 5. The triangle wave is even, so only cosine projections are needed. Half-wave
antisymmetry then removes the even cosine harmonics.
8 A useful check at the triangle peak
At x = 0,
The Fourier series gives
Cancel A:
Therefore
This identity will later connect naturally to Parseval-type arguments, but here it is simply a
consistency check obtained from the triangle-wave series.
9 Triangle-wave partial sums
Define
The coefficient magnitude now decreases like
which is much faster than the sawtooth’s 1∕n decay.
As a result, relatively few harmonics already reproduce the broad triangular shape well.
Figure 6. Triangle-wave partial sums using the first 1, 3, and 8 nonzero harmonics. The 1∕n2
coefficient decay makes the reconstruction settle rapidly compared with the sawtooth.
The triangle wave has no jump in the function value. Its non-smooth points are corners, where the
derivative changes abruptly. This difference in smoothness is reflected directly in the harmonic
spectrum.
10 Why the decay rates are different
We now have two exact coefficient laws:
and, for odd n,
The sawtooth has a jump discontinuity in the function. One integration by parts leaves a nonzero
boundary contribution, which produces a factor proportional to 1∕n.
The triangle wave is continuous. Its first integration-by-parts boundary contributions cancel more
strongly, and the remaining calculation supplies another factor of 1∕n. The result is
1∕n2.
This suggests a broader principle:
The word “usually” matters. Precise statements require hypotheses about differentiability,
periodic endpoint matching, and integrability. Those refinements belong later in the
series.
Figure 7. Coefficient-magnitude comparison for equal amplitude A. The sawtooth envelope falls as
1∕n, while the nonzero triangle-wave coefficients fall as 1∕n2.
11 A derivative connection to the square wave
There is also a structural reason for the triangle wave’s extra factor of 1∕n.
Away from its corners, differentiate
For −π < x < 0,
while for 0 < x < π,
Thus the derivative is a scaled square wave with opposite sign convention:
where
FS07 gave
Formally integrating a sine harmonic divides by its harmonic number. This hints at why
integrating a square-wave spectrum proportional to 1∕(2k + 1) produces a triangle-wave spectrum
proportional to 1∕(2k + 1)2.
The rigorous rules for differentiating and integrating Fourier series are deferred to FS17. Here this
relation is used only as a structural preview.
12 The extra factor of 1∕n: an integration-by-parts comparison
The exact formulas already show the decay rates. It is useful to see where the extra factor of 1∕n
enters the calculus.
For the sawtooth, the coefficient contains
After one integration by parts,
The second term vanishes, but the boundary term does not:
The nonzero endpoint contribution leaves exactly one Power of 1∕n.
Now consider the triangle coefficient in the form
Integrate by parts with
Then
Therefore
| In(t) | = 0π + ∫
0π sin(nx) dx. | (68) |
The boundary term now vanishes because
The remaining sine integral contributes another factor of 1∕n:
Hence
So the contrast can be summarized as follows:
- sawtooth: a nonzero boundary contribution survives after one integration by parts,
giving 1∕n;
- triangle: the first boundary contribution vanishes, and a second 1∕n enters through the
remaining integral, giving 1∕n2.
This is the concrete calculus behind the spectral-decay comparison.
13 How much faster is 1∕n2 decay?
The phrases “1∕n decay” and “1∕n2 decay” become more intuitive if we compare harmonics whose
index differs by a factor of two.
For the sawtooth envelope,
Doubling harmonic number cuts the envelope in half.
For the triangle envelope,
where the comparison refers to the nonzero-harmonic envelope rather than to an even triangle
coefficient, which is exactly zero.
Thus doubling harmonic number reduces the triangle-wave envelope by a factor of four.
For equal amplitude A, a few representative magnitudes are
| n | sawtooth envelope 2A∕(πn) | triangle envelope 8A∕(π2n2) |
|
|
|
| 1 | 0.63662A | 0.81057A |
| 3 | 0.21221A | 0.09006A |
| 5 | 0.12732A | 0.03242A |
| 9 | 0.07074A | 0.01001A |
The triangle’s fundamental can be larger, yet its higher harmonics become smaller much more
quickly.
14 Why other books may show different-looking formulas
A periodic waveform can be shifted horizontally without changing its geometric shape. A
shift changes Fourier phase, so two correct series for “a triangle wave” need not look
identical.
Our centered triangle has its positive peak at x = 0 and is even. Therefore its series uses cosine
terms:
Now shift the waveform by π∕2:
Then
For an odd integer m = 2k + 1,
Therefore
So a sine-only triangle-wave formula found in another reference may simply describe a triangle
wave whose origin is chosen at a different point in the cycle.
The same warning applies to the sawtooth. Reversing the ramp direction changes coefficient signs,
and shifting the jump changes harmonic phases. Always compare the waveform definition before
comparing formulas.
15 General interval [−L,L]: sawtooth
Define
with period 2L.
FS06 gives the sine coefficient formula
By odd symmetry,
The same integration-by-parts calculation gives
Therefore
Notice something important: the coefficient numbers are independent of L. Changing L changes
the basis frequencies, not the dimensionless coefficient pattern for the same normalized waveform
shape.
16 General interval [−L,L]: triangle wave
Define
This waveform is even and has zero mean. Its cosine coefficients are
After the scaled substitution u = πx∕L, the integral becomes exactly the same dimensionless
integral as on [−π,π]. Therefore
Thus
Again the numerical coefficients are unchanged. Only the harmonic spatial frequencies depend on
L.
17 Time-domain forms
For a time-periodic signal of period T, use
so that
A centered sawtooth may be written over one period as
Its series is
A centered triangle wave is
with series
18 Numerical example: equal-amplitude waveforms
Let
Then
For the sawtooth,
| b1 | = V ≈ 3.1831 V, | (96)
|
| b2 | = − V ≈−1.5915 V, | (97)
|
| b3 | = V ≈ 1.0610 V. | (98) |
For the triangle wave,
| a1 | = V ≈ 4.0528 V, | (99)
|
| a3 | = V ≈ 0.4503 V, | (100)
|
| a5 | = V ≈ 0.1621 V. | (101) |
The triangle-wave harmonics decrease much more rapidly.
At the same fundamental frequency, the two waveforms therefore place very different amounts of
signal amplitude into their high-frequency harmonics.
19 What FS08 has established
We can now summarize the two complete series.
For the odd sawtooth,
For the centered triangle wave,
The essential comparison is
whereas
This is our first explicit spectral signature of smoothness.
Figure 8. FS08 closes the first waveform-derivation block. FS09 formalizes even and odd
symmetry as a systematic coefficient-reduction tool.
20 Self-check questions
- Why does the sawtooth have no cosine coefficients?
- Why does the triangle wave have no sine coefficients?
- Why do all positive integer harmonics appear in the sawtooth series?
- Why do only odd harmonics appear in the centered triangle-wave series?
- Which waveform is continuous at the period boundary?
- Which coefficient law decays faster: 1∕n or 1∕n2?
- What feature of the triangle wave prevents the classic jump-type Gibbs phenomenon
in the function itself?
- Why do the dimensionless coefficient values remain unchanged when the interval
changes from [−π,π] to [−L,L] for geometrically similar waveforms?
- How is the derivative of the triangle wave related to a square wave away from the
corners?
- Which later article will justify differentiation and integration of Fourier series more
carefully?
21 Practice problems
- For A = 3, compute b1,b2,b3,b4 for the sawtooth wave.
- Write the five-harmonic partial sum S5(s)(x) for a unit-amplitude sawtooth.
- Verify directly that the sawtooth has zero mean on [−π,π].
- For A = 2, compute a1,a3,a5 for the triangle wave.
- Verify that the triangle-wave constant coefficient is zero by comparing positive and
negative triangular areas.
- Show from Eq. (43) that all even cosine coefficients vanish.
- Evaluate the first four nonzero terms of the triangle-wave series at x = 0 and compare
with A.
- On [−L,L], derive the sawtooth coefficient bn directly rather than by rescaling.
- On [−L,L], derive the triangle coefficient an using u = πx∕L.
- Explain in words why a 1∕n2 spectrum is more concentrated at low harmonics than a
1∕n spectrum.
- For a 500 Hz sawtooth, list the frequencies of its first six harmonics.
- For a 500 Hz triangle wave, identify which of the first six integer harmonic frequencies
have zero coefficients.
22 Where the series goes next
FS07 and FS08 used symmetry repeatedly because it was useful. FS09 now makes that idea
systematic. It develops even and odd decomposition as a general Fourier tool, clarifies when
sine or cosine families disappear, and prepares for half-range expansions later in the
sequence.
References
[1] R. V. Churchill and J. W. Brown, Fourier Series and Boundary Value Problems,
McGraw-Hill.
[2] E. Kreyszig, Advanced Engineering Mathematics, Wiley.
[3] R. N. Bracewell, The Fourier Transform and Its Applications, McGraw-Hill.