As of Version 7.0, FourierCosCoefficient is part of the built-in Mathematica kernel.
FourierCosCoefficient[expr, t, n] gives the n coefficient in the Fourier cosine series expansion of expr, where expr is a periodic function of t with period 1.
The n coefficient in the Fourier cosine series expansion of expr is by default defined to be for n>0 and for n0.
If n is numeric, it should be an explicit integer.
Different choices for the definition of the Fourier cosine series expansion can be specified using the option FourierParameters.
With the setting FourierParameters->{a, b}, expr is assumed to have a period of , and the n coefficient computed by FourierCosCoefficient is for n>0 and for n0.