Let f(x) be a periodic function of period 8 defined by:
f(x) = 4 if -4 < x < 0
f(x) = 0 if 0 < x < 4
Then the Fourier series of f is:
f(x) = (a0/2) + Σ(an*cos(nπx/4) + bn*sin(nπx/4))
where:
a0 = (1/4) * ∫[0,4] f(x) dx
an = (1/2) * ∫[0,4] f(x)*cos(nπx/4) dx
bn = (1/2) * ∫[0,4] f(x)*sin(nπx/4) dx
The coefficients are given by:
a0 = 2
an = (4/((nπ)^2)) * (1 - (-1)^n)
bn = (2/(nπ)) * (1 - (-1)^n)