CalZone Logo
User
Specialist Mathematics Tool

Fourier Series Calculator

Fourier's insight is one of most consequential in mathematics, any periodic function, however jagged, can be rebuilt as a sum of smooth sines and cosines. Our fourier series calculator computes coefficients of that sum for any function you enter, shows integrals behind each one and plots partial sums so you can watch series converge onto original function.

Fourier Series Solver

Fourier Series Expansion
(4/π) [ sin(1t) + sin(3t)/3 + sin(5t)/5 + sin(7t)/7 + sin(9t)/9 ]

Signal Reconstruction

Fourier series shows that any periodic signal can be decomposed into a sum of simple oscillating functions (sines and cosines). As the number of harmonics n increases, the approximation becomes closer to the actual wave.

How the Fourier Series Calculator Works

Enter your function and its period, and the calculator evaluates the three coefficient integrals, assembles the series, and displays it term-by-term alongside the mathematical working. For a function with period 2L, the series takes the form:

f(x) = a₀/2 + Σ [aₙ cos(nπx/L) + bₙ sin(nπx/L)]

with the coefficients found by integrating over one full period:

  • a₀: (1/L) ∫ f(x) dx
  • aₙ: (1/L) ∫ f(x) cos(nπx/L) dx
  • bₙ: (1/L) ∫ f(x) sin(nπx/L) dx

The idea behind these integrals is orthogonality: each sine and cosine mode picks out exactly its own share of the function and ignores every other frequency, which is why coefficients can be computed one at a time. For basic statistical dispersions, you can also view our Standard Deviation Calculator.

Fourier Series Symmetry & Coefficient Simplification:

Function TypeSymmetry PropertyNon-Zero CoefficientsSeries Type
Even Functionf(-x) = f(x)a₀ and aₙ (bₙ = 0)Cosine Series
Odd Functionf(-x) = -f(x)bₙ (a₀ = 0, aₙ = 0)Sine Series
General FunctionNeither symmetrya₀, aₙ, and bₙCombined Sine/Cosine Series
Half-Wave Symmetricf(x + T/2) = -f(x)Only odd harmonics surviveOdd Harmonics Only

The Shortcut That Halves the Work

Before integrating anything, check the symmetry of your function, because it can eliminate half the coefficients instantly:

  • Even Functions: Symmetric about the y-axis (like x² or |x|). They contain no sine terms; every bₙ is zero, and the result is a pure cosine series.
  • Odd Functions: Antisymmetric (like x or x³). They contain no cosine terms; every aₙ and a₀ vanishes, leaving a pure sine series.

Spotting symmetry first is the difference between computing three families of integrals and computing just one. When a function has neither symmetry, all three coefficient types survive and the full machinery applies.

The Classic Example: Square Wave

The square wave, equal to -1 on (-π, 0) and +1 on (0, π), is the standard introductory example because everything about it is instructive. It is odd, so only sine terms survive, and integrating gives bₙ = 4/nπ for odd n, and zero for even n:

f(x) = (4/π) [ sin x + (sin 3x)/3 + (sin 5x)/5 + ... ]

Three things are worth noticing. First, only odd harmonics appear, each shrinking as 1/n. Second, adding terms visibly sharpens the corners of the approximation, which is what the calculator's partial sum plots demonstrate. Third, at the jump itself, the series overshoots by about 9 percent no matter how many terms are added—a permanent artefact called the Gibbs phenomenon that appears at every discontinuity of every Fourier series.

What the Series Converges To

Convergence has one rule worth memorising: at points where the function is continuous, the series converges to the function's value; at a jump discontinuity, it converges to the midpoint of the two sides. So the square wave's series lands on 0 at x = 0, exactly halfway between -1 and +1. Smoothness also controls speed: the smoother the function, the faster the coefficients decay, which is why a continuous triangle wave needs far fewer terms than a square wave for the same accuracy.

Why Fourier Series Matter

The applications flow from one interpretation: the coefficients are the frequency content of the function. In sound, they are literally the harmonics that make a violin and a clarinet playing the same note sound different. In engineering, expressing a signal or load as sines lets each frequency be analysed separately, which is how vibration analysis, audio compression, and electrical waveform design all work.

Historically, Fourier built this tool to solve the heat equation, where each sine mode decays at its own rate—a method that still underpins the solution of partial differential equations in university courses today. For students, Fourier series arrive in A Level Further Maths extension work and become core material in engineering and mathematics degrees.

Fourier Series FAQs

Explore CalZone's Specialist UK Calculators

Plan your home, property, business tax, automotive costs, and daily health metrics with our specialist tools.