Fourier Coefficients Explained with Worked Examples

The coefficients of a Fourier series are and . They follow from the orthogonality of the sines and cosines.

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Fourier coefficients means

For on (an odd function, so all ), integration by parts (integration by parts) gives : , , . For (even, so ): and , so , and the constant term is .

For : , , so and . Symmetry saves work: even functions have only cosines, odd functions only sines (symmetry of graphs, properties of the trigonometric graphs). The integrals use sine and cosine integrals.

The coefficients decay like for a function with a jump and like for a continuous function with corners; smoother functions give faster decay. They are the building blocks of the Fourier series, and their squares add up as in Parseval's identity.

What is it used for?

The coefficients measure how much of each frequency a function contains.

How to use fourier coefficients

  1. Use symmetry: even , odd .
  2. Write the integral for or and integrate by parts.
  3. Simplify using , .
  4. Substitute .

Graph

The coefficients b_n = 2(−1)^(n+1)/n of f(x) = xb1 = 2b2 = −1b3 = 0.66700.511.522.533.544.55-1-0.500.511.52The coefficients b_n = 2(−1)^(n+1)/n of f(x) = xnb_nGraph with x from 0 to 5 and y from -1.2 to 2.4. Shows b_n (4); point b1 = 2 at (1, 2); point b2 = −1 at (2, -1); point b3 = 0.667 at (3, 0.6667).

The signs alternate and the sizes decay like 1/n.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: f(x) = x

Find for on .

Worked example
Answer
b1=2, b2=−1, b3=0.6667b_1=2,\ b_2=-1,\ b_3=0.6667
  1. Formula

Example 2: f(x) = x²

Find , and the constant term for on .

Worked example
Answer
a1=−4, a2=1, a02=3.2899a_1=-4,\ a_2=1,\ \dfrac{a_0}{2}=3.2899
  1. a_n
  2. a₀/2

Example 3: f(x) = |x|

Find and for on .

Worked example
Answer
a1=−1.2732, a2=0a_1=-1.2732,\ a_2=0
  1. a₁
  2. a₂

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

f = x on (−π, π)

bₙ = 2(−1)^(n+1)/n

b₁ = 2, b₂ = −1.

b₃

2/3

0.6667.

f = x²

aₙ = 4(−1)ⁿ/n²

a₁ = −4, a₂ = 1.

Constant term

π²/3

3.2899.

Word problems

aₙ = (1/L)∫f cos(nπx/L)dx and bₙ = (1/L)∫f sin(nπx/L)dx. Odd functions have only sine terms, even functions only cosine terms.

b₁ for f = x

Use bₙ = 2(−1)^(n+1)/n.

  1. 2 × 1/1
  2. Check: ✓2.

b₃

Find b₃.

  1. 2/3
  2. Check: ✓0.6667.

a₁ for x² Higher

Use aₙ = 4(−1)ⁿ/n².

  1. −4
  2. Check: ✓−4.

Constant term Higher

Find a₀/2 = π²/3 for x².

  1. 9.8696/3
  2. Check: ✓3.2899.

Common mistakes

Using both for odd f

aₙ ≠ 0 ✗

aₙ = 0 for odd f ✓

Symmetry.

Sign of (−1)^(n+1)

(−1)ⁿ ✗

(−1)^(n+1) ✓

bₙ alternates starting positive.

Forgetting 1/L

omitted ✗

include 1/L ✓

Normalisation.

a₀ vs a₀/2

constant a₀ ✗

constant a₀/2 ✓

Half.

Exam tips

  1. Odd: bₙ only.
  2. Even: aₙ only.
  3. 1/L factor.
  4. Constant a₀/2.
  5. By parts for polynomials.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. b₂ for f = x Foundation

-1

2. b₄ for f = x Foundation

-0.5

3. a₃ for x² to 4 d.p. Foundation

-0.4444

4. a₂ for x² Higher

1

5. b₅ for f = x to 4 d.p. Higher

0.4

6. π²/3 to 4 d.p. Higher

3.2899

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Fourier coefficient
aₙ, bₙ.
Orthogonality
Integrals of products vanish.
Odd function
f(−x) = −f(x).
Even function
f(−x) = f(x).
Constant term
a₀/2.
Integration by parts
Method for x·sin.

Frequently asked questions

How do I find bₙ?

(1/L)∫f sin(nπx/L)dx.

What are bₙ for f = x?

2(−1)^(n+1)/n.

What are aₙ for f = x²?

4(−1)ⁿ/n².

Why do odd functions have no cosines?

The integrals vanish by symmetry.

Which page covers Fourier series?

Fourier series.

Which page covers Parseval?

Parseval’s identity.

More in Differential equations and transforms and the formula sheets.