Expand a symmetric absolute-value waveform

An even waveform can be expanded with a constant plus cosine terms. Use symmetry to integrate over half the interval. For f(x) = |x| on −π ≤ x ≤ π, the positive half is simply x. Extending this shape periodically produces a triangular waveform. Its corners affect the higher harmonics, but the function itself is continuous at the joined endpoints.

Worked practice example

Calculate the Fourier series of f(x) = |x| on −π ≤ x ≤ π.

Step Working
Mean term a₀ = (2/π)∫ from 0 to π x dx = π, so a₀/2 = π/2.
Cosine coefficient aₙ = (2/π)∫ from 0 to π x cos(nx) dx.
Integrate by parts The definite integral is [((−1)ⁿ − 1)/n²], so aₙ = 2[((−1)ⁿ − 1)]/(πn²).
Simplify Even n give 0; odd n give −4/(πn²). Therefore |x| = π/2 − (4/π)[cos x + cos(3x)/9 + cos(5x)/25 + …].

Check your method

All sine coefficients vanish because |x| is even. At x = 0, the cosine terms must sum to cancel π/2. The coefficients decrease as 1/n², so adding harmonics refines the corners without changing the mean.

Try it yourself

For f(x) = 3|x|, give the mean term and the coefficient of cos(3x).

Show the answer and method

Linearity multiplies all coefficients by 3. The mean becomes 3π/2, while the coefficient of cos(3x) is −12/(9π) = −4/(3π).

This written practice example was prepared for Jemshah revision. It is additional practice, not an official examination question or a transcript of the video.