FourierCosSeries of DiracDelta[x] mismatch

When I do*

FourierCosSeries[DiracDelta[x - 0.0001], x, 5]


I get as a result

{0.140401, 1/\[Pi] + 0.63662 Cos[x] + 0.63662 Cos[2 x] + 0.63662 Cos[3 x] + 0.63662 Cos[4 x] + 0.63662 Cos[5 x]}.


Where each coefficient is a factor two too big. (The Delta function)

Using

FourierSeries[DiracDelta[x], x, 5]


on the other hand, gives the correct result

{0.140401, 1/(2 \[Pi]) + E^(-I x)/(2 \[Pi]) + E^(I x)/(2 \[Pi]) + E^(-2 I x)/(2 \[Pi]) + E^(2 I x)/(2 \[Pi]) + E^(-3 I x)/(2 \[Pi]) + E^(3 I x)/(2 \[Pi]) + E^(-4 I x)/(2 \[Pi]) + E^(4 I x)/(2 \[Pi]) + E^(-5 I x)/(2 \[Pi]) + E^(5 I x)/(2 \[Pi])}


(it is easy to see by using 2cos(x)=exp(ix)+exp(-ix) that the two expressions differ by a factor two) So I know the correct expansion, but I prefer to trace back the origin of the mistake, to avoid similar wrong results in the future.

*The -0.0001 in the argument of the delta-function prevents me from getting a bunch of HeavisideTheta[0]'s in the answer

I tried another random symmetric function and the problem doesn't seem to persist there.

• Have you looked up FourierParameters? The default normalization in Mathematica might be different than the one you expect. – march Oct 17 '16 at 15:57