Exact Fourier coefficient from large expression

I have a relatively simple analytic expression

(-1.4676*10^-6 + 1.24345*10^-6 I) (1. + Cos[tt])^2 (-4.4958*10^6 +
1.08256*10^6 Cos[tt] - 231135. Cos[tt]^2 + 44216.1 Cos[tt]^3 -
7621.15 Cos[tt]^4 + 1227.17 Cos[tt]^5 - 154.92 Cos[tt]^6 +
33.5441 Cos[tt]^7 + 0.688651 Cos[tt]^8 +
1. Cos[tt]^9) (-1.4025264490430390469 Cos[
0.8443926998901367188 t] + (0. +
1.40253 I) Sin[(0.844393 + 0. I) t]) (Cos[(2. + 0. I) (Pi +
pp + 0.422196 r - (0. + 0.416136 I) Cos[tt])] + (0. +
1. I) Sin[(2. + 0. I) (Pi + pp +
0.422196 r - (0. + 0.416136 I) Cos[tt])])


and I would like to get the FourierCoefficients in pp from it. If I simply apply FourierCoefficient, I get the error message:

Factor::lrgexp: Exponent is out of bounds for function Factor.

Now, through a combination of TrigToExp, Expand, and Collect, I can single out the Exp[2 I pp] and then apply FourierCoefficient. However, the resulting expression is rather lengthy, which is a problem since I need to integrate over tt afterwards (takes a long time). In practice, up to some normalization factor, I could also just set pp->0 and be done with it; while that is a rather quick solution, I also have cases, in which the expression contains more than just on non-zero Fourier coefficient. In this cases, I cannot set pp->0.

So now I am wondering, whether there is a neat trick with which I don't have to Expand the expression and collect all the respective exponentials, but still obtain an analytic expression.

Z = (-1.4676*10^-6 + 1.24345*10^-6 I) (1. + Cos[tt])^2 (-4.4958*10^6 + 1.08256*10^6 Cos[tt] -
231135. Cos[tt]^2 + 44216.1 Cos[tt]^3 - 7621.15 Cos[tt]^4 + 1227.17 Cos[tt]^5 -
154.92 Cos[tt]^6 + 33.5441 Cos[tt]^7 + 0.688651 Cos[tt]^8 + 1. Cos[tt]^9) (-1.4025264490430390469
Cos[0.8443926998901367188 t] + (0. + 1.40253 I) Sin[(0.844393 + 0. I) t]) (Cos[(2. + 0. I)
(Pi + pp + 0.422196 r - (0. + 0.416136 I) Cos[tt])] + (0. + 1. I) Sin[(2. + 0. I) (Pi +
pp + 0.422196 r - (0. + 0.416136 I) Cos[tt])]);


expand only those trigonometric functions that contain pp:

Z1 = Expand[Z /. {1. -> 1, Complex[2., 0.] -> 2, Complex[0., 1.] -> I}
/. {Cos[z : _. (_. pp + _.) + _.] -> (E^(I z) + E^(-I z))/2,
Sin[z : _. (_. pp + _.) + _.] -> (E^(I z) - E^(-I z))/(2I)}];


get the Fourier coefficients:

Table[FourierCoefficient[Z1, pp, i], {i, -2, 2}]


faster:

c[2]  = Coefficient[Z1, E^(2 I pp)] // Simplify
c[1]  = Coefficient[Z1, E^(I pp)] // Simplify
c[-1] = Coefficient[Z1, E^(-I pp)] // Simplify
c[-2] = Coefficient[Z1, E^(-2 I pp)] // Simplify
c[0]  = Z1 - {c[2], c[1], c[-1], c[-2]}.{E^(2 I pp), E^(I pp), E^(-I pp), E^(-2 I pp)} // Simplify

• Well, this is basically equivalent to setting pp->0, but as a pointed out, this is not very helpful, when considering expressions with several different Fourier coefficients. – Nils May 14 at 21:37