Fourier Series Calculator
Compute Fourier cosine and sine coefficients for standard periodic waveforms.
Inputs
Function on [-π, π], used only for custom waveform.
Fourier sum at x
0.88709926
a₀ (DC term)
0.00000000
Coefficients (first terms)
b1=1.27324, b3=0.42441
Step by step
Values used
Waveform = Square wave; f(x) (for custom) = x; Number of terms (N) = 5; Evaluate at x = 1
Fourier series
f(x) = a₀/2 + Σ [aₙ·cos(nx) + bₙ·sin(nx)]
Coefficients
aₙ = (1/π)∫[-π,π] f(x)cos(nx)dx, bₙ = (1/π)∫[-π,π] f(x)sin(nx)dx
Fourier sum at x
= 0.88709926
a₀ (DC term)
= 0.00000000
Coefficients (first terms)
= b1=1.27324, b3=0.42441
How it works
The Fourier series represents a periodic function as a sum of sines and cosines: f(x) = a₀/2 + Σ[aₙcos(nx) + bₙsin(nx)]. This calculator provides exact coefficients for standard waveforms (square, sawtooth, triangle) and numerical coefficients via integration for custom functions on [-π, π].
Formulas
Fourier series
f(x) = a₀/2 + Σ [aₙ·cos(nx) + bₙ·sin(nx)]
- a₀
- DC component (average)
- aₙ
- Cosine coefficients
- bₙ
- Sine coefficients
- n
- Harmonic number
Coefficients
aₙ = (1/π)∫[-π,π] f(x)cos(nx)dx, bₙ = (1/π)∫[-π,π] f(x)sin(nx)dx
- aₙ
- n-th cosine coefficient
- bₙ
- n-th sine coefficient
Frequently Asked Questions
Why do square waves only have sine terms?
The square wave is an odd function, so all cosine (even) coefficients are zero. Only odd harmonics appear: b₁, b₃, b₅, ...
How many terms do I need for a good approximation?
Smooth functions converge quickly (5-10 terms). Discontinuous functions like square waves converge slowly due to Gibbs phenomenon.