Fourier Series Coefficients Calculator
Compute a0, an and bn for a stated period by numeric integration, with the interval and tolerance printed.
Fourier Series Coefficients Calculator
Compute a0, an and bn for a stated period by numeric integration, with the interval and tolerance printed.
How this page computes
The page integrates the function against cosines and sines over the stated period with adaptive Simpson. The coefficients are numeric estimates, and the period and tolerance are inputs rather than hidden constants.
The calculation runs entirely in this browser tab; nothing is uploaded.
The page computes Fourier coefficients a0, an and bn over the period you state, using numeric integration. Worked example: x^2 on the period 2*pi has a0 about 6.5797 and a1 = -4.
The period and the number of harmonics are inputs, and the output names both the period and the integration interval. The coefficients are numeric estimates from adaptive Simpson, not a symbolic derivation.
How to use the Fourier Series Coefficients Calculator
Enter an expression in x, set the period T, the number of harmonics and the integration tolerance, then press Run. The output starts with the interval [-T/2, T/2] that was integrated.
Each harmonic prints an and bn on one line. A function with no sine component shows bn values near zero, and the page leaves the small numeric residue visible rather than rounding it to a claim.
The coefficient formulas used
a0 is 2/T times the integral of the function over one period. an and bn are 2/T times the integral against cos(2*pi*n*x/T) and sin(2*pi*n*x/T) respectively.
Every integral uses adaptive Simpson with the stated tolerance on the printed interval. The result is an estimate of the coefficients, which is why the page does not call the series exact.
What to Expect
Best for
- Estimating the first few Fourier coefficients
- Checking the even/odd symmetry of a function
- Seeing the period and interval explicitly
Not ideal for
- A symbolic Fourier series
- A proof of convergence
- A signal with a discontinuity sampled exactly
What this tool keeps
- The period, interval, harmonic count, tolerance and every coefficient
What may need cleanup
- Coefficients are numeric estimates; round them to the tolerance they support
Common errors
- A non-positive period is refused
- A harmonic count outside 1 to 20 is refused
Example use cases
- Compute the first three coefficients of x^2
- Check that a sine coefficient is near zero for an even function
Sample input
x^2
Sample output
Fourier coefficients for x^2 on period T = 6.28318530718 (interval [-3.14159265359, 3.14159265359]) a0 = 6.57973626739 a1 = -4, b1 = 0 a2 = 0.999999999998, b2 = 0 a3 = -0.444444444528, b3 = 0 coefficients by adaptive Simpson on the stated period, tolerance 1e-7
Who this is for
- Students learning Fourier coefficients
- Readers checking a signal decomposition
Frequently asked questions
Which period convention is used?
The page integrates over [-T/2, T/2] and prints that interval. It uses the 2/T normalization for a0, an and bn, so the coefficients match the standard real Fourier series for that period.
Why are some coefficients not exactly zero?
They are numeric integrals, so a coefficient that is mathematically zero can leave a residue near the integration tolerance. The page shows the residue rather than hiding it behind an exact-zero claim.
Can the function be discontinuous?
Adaptive Simpson will refine near a jump but cannot represent it exactly, and the coefficients will carry the integration error. The page states the tolerance so the result is read as an estimate.
Is anything uploaded?
Nothing is uploaded. The integrand is sampled and integrated in this browser tab, and reloading the page discards the input and the coefficients.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.