Calculate an even series with integration by parts

For an even function on −π ≤ x ≤ π, calculate a₀ and aₙ over 0 ≤ x ≤ π and set bₙ = 0. The coefficient integral can require integration by parts twice. Keep the factor 2/π outside the integral until the endpoints have been evaluated, and distinguish a₀ from the constant a₀/2 in the final series.

Worked practice example

Find the Fourier series for the periodic extension of f(x) = x² on −π ≤ x ≤ π.

Step Working
Mean coefficient a₀ = (2/π)∫ from 0 to π x² dx = 2π²/3, so a₀/2 = π²/3.
First integration by parts ∫x² cos(nx) dx = x² sin(nx)/n − (2/n)∫x sin(nx) dx.
Apply the limits ∫ from 0 to π x² cos(nx) dx = 2π(−1)ⁿ/n².
Coefficient and series aₙ = 4(−1)ⁿ/n². Thus x² = π²/3 + 4Σ from n = 1 to ∞ [(−1)ⁿ cos(nx)/n²].

Check your method

At x = 0 the formula gives 0 = π²/3 + 4Σ(−1)ⁿ/n². This is a useful consistency check on the signs. Both endpoints of the periodic extension meet at π², so there is no jump in the function there, although its slope changes.

Try it yourself

What changes if the function is f(x) = x² + 2 on the same interval?

Show the answer and method

Only the mean term changes: a₀/2 becomes π²/3 + 2. For n ≥ 1 the cosine coefficients stay 4(−1)ⁿ/n², and every sine coefficient stays zero.

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