---
title: "Fourier series of a function"
subject: "Mathematics III"
chapter: 4
key: "semester_3/mathematics_iii:fourier-series-of-a-function"
source: https://www.bctengineer.com/q/semester_3/mathematics_iii/fourier-series-of-a-function
site: BCT Engineering
---

# Fourier series of a function

Mathematics III · Chapter 4: Fourier Series

- Asked in: 2080 Baishakh, 5 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/mathematics_iii/fourier-series-of-a-function
- Whole chapter: https://www.bctengineer.com/md/semester_3/mathematics_iii/chapter-4

## Question

Obtain a Fourier series to represent x + x² for −π ≤ x ≤ π and deduce that π²/6 = 1/1² + 1/2² + 1/3² + 1/4² + ...

## Short answer

Fourier series: x + x² = π²/3 + Σ_{n=1}∞ [4(−1)^n cos nx / n² + 2(−1)^(n+1) sin nx / n]. At x=π, the mean of endpoints gives π² = π²/3 + 4 Σ 1/n², hence Σ 1/n² = π²/6.

## Answer

f(x) = x + x² on (−π, π). Split into the odd part x and the even part x².

#### Coefficients
```text
a₀ = (1/π) ∫_{−π}^{π} (x + x²) dx = (1/π)(2π³/3) = 2π²/3
aₙ = (1/π) ∫ (x + x²) cos nx dx = (1/π) ∫ x² cos nx dx = 4(−1)ⁿ/n²
bₙ = (1/π) ∫ (x + x²) sin nx dx = (1/π) ∫ x sin nx dx = 2(−1)ⁿ⁺¹/n
```

(x cos nx and x² sin nx are odd, so they integrate to zero.)

#### Series
```text
x + x² = π²/3 + Σ_{n=1}^∞ [ 4(−1)ⁿ cos nx / n² + 2(−1)ⁿ⁺¹ sin nx / n ]
       = π²/3 − 4cos x + cos 2x − (4/9)cos 3x + ...
         + 2 sin x − sin 2x + (2/3) sin 3x − ...
```

#### Deduction
At the end point x = π the series converges to the mean of the end values:

```text
[f(π) + f(−π)]/2 = [(π + π²) + (−π + π²)]/2 = π²
```

At x = π, sin nπ = 0 and cos nπ = (−1)ⁿ, so

```text
π² = π²/3 + 4 Σ (−1)ⁿ(−1)ⁿ/n² = π²/3 + 4 Σ 1/n²
```

**Hence π²/6 = 1/1² + 1/2² + 1/3² + 1/4² + ...** ∎

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why do a_n come only from x^2 and b_n only from x in x + x^2 on (−π, π)?
   A. x^2 is even and x is odd; x cos nx and x^2 sin nx are odd and integrate to zero
   B. x^2 is odd and x is even
   C. Both terms are even so all coefficients are equal
   D. The interval is not symmetric
   Answer: A. Odd integrands over a symmetric interval give zero, so cosine terms come from the even part and sine terms from the odd part. (Key point: Odd/even split)

2. For f(x) = x + x^2, a0 and bn are:
   A. a0 = π^2/3, bn = 2(−1)^n/n
   B. a0 = 2π^2/3, bn = 2(−1)^(n+1)/n
   C. a0 = 2π^2/3, bn = 0
   D. a0 = 0, bn = 2(−1)^(n+1)/n
   Answer: B. a0 = (1/π)(2π^3/3) = 2π^2/3 and bn comes from ∫ x sin nx. (Key point: Coefficients)

3. At x = π the series converges to:
   A. f(π) = π + π^2
   B. f(−π) = −π + π^2
   C. The mean [f(π) + f(−π)]/2 = π^2
   D. 0
   Answer: C. At the end point the periodic extension jumps, so the series gives the average of the two end values, π^2. (Key point: Convergence at end point)

4. Setting x = π in the series gives π^2 = π^2/3 + 4Σ1/n^2. Hence Σ1/n^2 =
   A. π^2/3
   B. π^2/12
   C. π^2/4
   D. π^2/6
   Answer: D. 4Σ1/n^2 = 2π^2/3, so Σ1/n^2 = π^2/6. (Key point: Deduction)

## Close variants set in other exams

- [Fourier series: x − x²](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Afourier-series-x-x2) — Mathematics III, chapter 4, asked 6×

## Related in Mathematics III

- [Fourier series: eˣ](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Afourier-series-e) — Mathematics III, chapter 4, asked 6×
- [Fourier series: x²](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Afourier-series-x2) — Mathematics III, chapter 4, asked 9×
- [Fourier series: x sin x](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Afourier-series-x-sin-x-two) — Mathematics III, chapter 4, asked 7×
- [Fourier series: |x|](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Afourier-series-x) — Mathematics III, chapter 4, asked 6×
- [Fourier series: x³](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Afourier-series-x3) — Mathematics III, chapter 4, asked 6×
- [Fourier series: x − x²](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Afourier-series-x-x2-two) — Mathematics III, chapter 4, asked 2×

## Related in other subjects

- [Fourier series of rising sawtooth −V0 to V0](https://www.bctengineer.com/question.md?key=semester_3%2Felectrical_circuit_theory%3Afourier-sawtooth-minus-v0-to-v0) — Electrical Circuit Theory, chapter 6
- [Fourier series of falling sawtooth V to 0](https://www.bctengineer.com/question.md?key=semester_3%2Felectrical_circuit_theory%3Afourier-falling-sawtooth-v-to-0) — Electrical Circuit Theory, chapter 6
- [Fourier series of ramp wave 0 to 20](https://www.bctengineer.com/question.md?key=semester_3%2Felectrical_circuit_theory%3Afourier-ramp-0-to-20-period) — Electrical Circuit Theory, chapter 6
- [Line voltage Fourier series: triplen harmonics absent](https://www.bctengineer.com/question.md?key=semester_7%2Fpower_electronics%3Asquare-wave-inverter-triplen-absent) — Power Electronics, chapter 5
