Fourier Series
Approximate a periodic function with harmonics
About this calculator
The Fourier Series Calculator expands any periodic function f(x) into its trigonometric Fourier series a₀/2 + Σ aₙcos(nωx) + bₙsin(nωx), computing up to 50 harmonics by Simpson-rule integration of the Euler coefficient formulas over one symmetric period. Each harmonic is reported with its aₙ, bₙ, amplitude, and phase, and an optional evaluation point compares the partial sum against the true function value. Coefficients that vanish by symmetry snap cleanly to zero, and singularities on the period are detected.
How to use the Fourier Series calculator
- Enter the values for your problem into the input fields.
- Read the result — it updates instantly as you type.
- Check the formula and the visual explanation to follow how the answer was found.
- Copy the page URL to share the exact calculation.
Common examples
- Square wave sign(sin(x)), period 2π → b₁ ≈ 1.27324 (4/π), b₃ ≈ 0.424413, b₅ ≈ 0.254648, even harmonics 0
- Sawtooth f(x) = x, period 2 → b₁ ≈ 0.63662, b₂ ≈ −0.31831; S₃(0.5) ≈ 0.424413 vs f(0.5) = 0.5
- Triangle |x|, period 2 → mean 0.5, cosine-only terms a₁ ≈ −0.405285, a₃ ≈ −0.0450316
- cos(x) over period 2π → recovers a₁ = 1 exactly with every other coefficient 0
Frequently asked questions
How does the Fourier Series calculator work?
Enter your values and the calculator applies the exact mathematical method for this problem, showing the result together with the formula it used. Everything is computed with high-precision arithmetic, so the answer you see is not limited by ordinary floating-point rounding.
When would I use the Fourier Series calculator?
It is useful for homework and exam preparation, for checking work done by hand, and whenever a step in a larger problem needs this calculation done quickly and reliably.
How accurate are the results?
Calculations run at 30 significant digits of precision internally. Displayed values are rounded for readability, but the underlying result is far more precise than a typical hand or pocket-calculator computation.
Can I share a specific calculation with someone else?
Yes. Every value you enter updates the URL, so copying the address bar and sharing the link reopens the exact same calculation for whoever clicks it.