The given function is of the square form. As f (x) is defined in the interval (−π, π), the Fourier expansion is given by

The graph of f (x) is shown in Fig. 1.8. It consists of the x-axis from −π to 0 and of the line AB from 0 to π. A simple discontinuity occurs at x = 0 at which point the series reduces to π/2.
Now, π/2 = 1/2[ f (0−) + f (0+)]

which is consistent with Dirichlet’s theorem. Similar behavior is exhibited at x = π, ±2π... Figure 1.8 shows first four partial sums with equations
y = π/2
y = π/2 + 2 sin x
y = π/2 + 2(sin x + (1/3) sin 3x)
y = π/2 + 2(sin x + (1/3) sin 3x + (1/5) sin 5x)