Discussion

This is a snap. Suppose we are interested in a function with period 2T. Instead of using cos(kx) and sin(kx) as our orthonormal set (that is, our "pure" periodic functions), we use
cos[(kPi/T) x] and sin[(kPi/T) x]
as our orthonormal set.

Notice we are using CAPITAL LETTERS now for the orthonormal set.


  U[x_,T_]:=Table[Cos[(k Pi/T) x],{k,10}]


  ColumnForm[U[x,T]]


  V[x_,T_]:=Table[Sin[(k Pi/T) x],{k,10}]


  ColumnForm[V[x,T]]

Skeptical?
These functions have period 2T. Let's just test a few, otherwise Mathematica might compute all day. We test if V[x,T]=V[x+2T,T] by subtracting and checking if we get zero. We need a special command for Mathematica to recognize trigonometric identites:


  Simplify[Factor[U[x,T][[3]]-U[x+2 T,T][[3]],Trig->True]]


  Simplify[Factor[U[x,T][[8]]-U[x+2 T,T][[8]],Trig->True]]

These functions are orthogonal. Test a few:


  Integrate[U[x,T][[4]] V[x,T][[6]],{x,-T,T}]


  Integrate[U[x,T][[2]] U[x,T][[7]],{x,-T,T}]


  Integrate[U[x,T][[1]] V[x,T][[9]],{x,-T,T}]

This is not an orthonormal set.
Each of these have norm Sqrt[T].
Recall that cos(kx) and sin(kx) had norm Sqrt[Pi]!
Test a few:


  Sqrt[Integrate[U[x,T][[9]] U[x,T][[9]],{x,-T,T}]]


  Sqrt[Integrate[V[x,T][[3]] V[x,T][[3]],{x,-T,T}]]

By complete analogy with what we did before, the Fourier coefficients are given by:
a0=(1/2T) Integral from -T to T of f(x)
ak=(1/T) Integral from -T to T of f(x)cos[(kPi/T) x]
bk=(1/T) Integral from -T to T of f(x)sin[(kPi/T) x]

If you need the cosine series of the even periodic extension:

a0=(1/T) Integral from 0 to T of f(x)
ak=(2/T) Integral from 0 to T of f(x)cos[(kPi/T) x]
bk=0

If you need the sine series of the odd periodic extension:

ak=0
bk=(2/T) Integral from 0 to T of f(x)sin[(kPi/T) x]

Up to Periods Other than 2Pi