The function has zero mean and its cosine coefficients vanish:
Its sine coefficients are
so
Away from the corners, . Differentiating the Fourier series shows that and . Also,
Consequently
and
Evaluating the series for at gives the Leibniz formula for π,
Evaluating the continuous Fourier series for at gives
and hence
At , the Fourier sum is , and only the odd cosine coefficients contribute. Therefore , giving
At , the sum is . All nonzero cosine terms vanish, and the sine terms have alternating signs over odd indices. Thus , so
This is the Leibniz formula for π obtained from the same Fourier series.