Recap

1. The inner product is defined by
IP(f,g)=Integral from -Pi to Pi of fg

2. a0=(1/2Pi) IP(f,Cos[0x])

3. ak=(1/Pi) IP(f,Cos[kx]) k=1, 2, 3, . . .
(In Mathematica we defined u to hold Cos[kx].)

4. bk=(1/Pi) IP(f,Sin[kx]) k=1, 2, 3, . . .
(In Mathematica we defined v to hold Sin[kx].)

5. The Fourier series is then
a0+ Sum (k=1 to infinity) [ak cos(kx) + bksin(kx)]

Up to Fourier Series