Fourier Series Calculator

Partial sums of the classic waveforms — square, sawtooth, triangle, parabola — with closed-form coefficients, the first coefficients listed, and the error at your x measured against the true function. Gibbs overshoot included, not hidden.

Example — Square wave at x = π/2, first 99 termsS₉₉(π/2) ≈ 0.9936 (true value 1)

All four waveforms live on (−π, π) and repeat every 2π. Try the square wave at x = 1.5708 (π/2) with N = 5, then N = 99.

How we got it — the example, step by step

  1. Coefficients: bₙ = 4/(nπ) for odd n and 0 for even n, all aₙ = 0 — from integrating the wave against sin(nx) once, in closed form.
  2. At x = π/2 the sines alternate +1, −1, +1…, so the sum becomes (4/π)(1 − 1/3 + 1/5 − 1/7 + …) — the Leibniz series wearing a Fourier coat.
  3. With 99 terms that gives 0.9936. The remaining 0.0064 is not sloppiness: convergence at a fixed point away from the jump is genuinely this slow.

Check it backwards

At just 5 terms and x = 1 the sum is 0.8871 against a true 1 — run the tool at N = 5, then N = 99, and watch the error fall exactly as the coefficient formula says it should.

Questions people also ask

Which waveforms are covered?
Four classics on (−π, π): the square wave, the sawtooth f(x) = x, the triangle f(x) = |x| and the parabola f(x) = x² — each with closed-form coefficients shown on the page. Arbitrary functions need numerical integration and are not covered yet.

Why is the square wave still off near its jump?
That is the Gibbs phenomenon: partial sums overshoot by about 8.95% of the jump height beside the discontinuity, at any number of terms. At the jump itself the series settles on the midpoint value.

What happens outside −π to π?
The series is 2π-periodic, so x is wrapped back into (−π, π) before comparing — the sawtooth's true value at x = 7 is 7 − 2π ≈ 0.7168.

Related calculators

Every answer on this page is computed, not typed from memory — the check under each result runs the calculation backwards. Figures are rounded only where the page says so. Last updated: October 13, 2026 · Clirto — every answer free, every step shown.

Made to stay free — built for students, teachers and everyone, not for a paywall »

◆ Clirto=✦ Plain-English Questions+✓ Step-by-Step Working+∞ Free Forever→▥ Instant Answers