Discussion

We will stay clear of the questions concerning convergence for a while. We now have an orthonormal set (which we will pretend is a basis). The idea behind Fourier series is to obtain every periodic function (even discontinuous ones) of period 2Pi as a combination of ek=(1/Sqrt[Pi])Cos[kx] and dk=(1/Sqrt[Pi])Sin[kx], in a sense the "pure" periodic functions, sine and cosine.

If a function is not periodic, we must redefine it so that it is (see the subsection on periodic extensions).

Our goal is to write f(x) as f(x)=a0e0+a1e1+b1d1+a2e2+b2d2+. . ., where the ak and bk are scalars (think basis!).

By the way, the e0 function is (1/Sqrt[2Pi])Cos[0x]=(1/Sqrt[2Pi]).
The Fourier coefficients of f (the ak and bk) are simply IP(f,ek) and IP(f,dk).

This isn't how Fourier series are usually encountered. Instead of f=Sum(k=1 to infinity) IP(f,ek)ek+IP(f,dk)dk, we want
a0+Sum(k=1 to infinity) akCos[kx]+bkSin[kx]. This is easy enough to accomplish. All of our functions Cos[kx] and Sin[kx] have length 1/Sqrt[Pi] (except for Cos[0x], which has length 1/Sqrt[2Pi]), so by factoring this out of ek and dk we get back to uk and vk (Cos[kx] and Sin[kx]) and by factoring 1/Sqrt[Pi] out of IP(f,ek) and IP(f,dk) we get IP(f,uk) and IP(f,vk)
OR
ak=(1/Pi)IP(f,Cos[kx]) and bk=(1/Pi)IP(f,Sin[kx]). [[The two factors of 1/Sqrt[Pi] combine to give 1/Pi in front of the inner product.]]

These are what we will call our Fourier coefficients.

Up to Fourier Series