Average of one over sum of complex exponentials I need to compute a time-average which is of the form
$$ \lim_\limits{T \to \infty} \frac{1}{T} \int_0^T \frac{\mathrm{d}t}{1+\sum_k c_k e^{i x_k t}} $$
where $x_k \in \mathbb{R}$, $c_k \in \mathbb{C}$ and the sum in the denominator is finite, $k=1,\ldots,K$.
I tried substituting $z = e^{it}$ and using the residue theorem but in the end I didn't get far. Is there some way of getting a closed form expression for the limit? Alternatively, I don't mind if I have to use numerical techniques, but preferably I'd do it on a limit where the convergence is more controlled.
 A: If the $c_k$ are small enough (say, $\sum_k |c_k| < 1$), then expanding the inverse in a Taylor series will work:
$$
\frac{1}{1+\sum_k c_k e^{ix_k t}}=1-\sum_kc_ke^{ix_k t}+\sum_{k,l}c_kc_le^{i(x_k+x_l)t}-\sum_{k,l,m}c_kc_lc_me^{i(x_k+x_l+x_m)t}+\ldots
$$
This can be regrouped by combining terms with the same number of copies of each $x_i$:
$$
=\sum_{n_1=0}^{\infty}\sum_{n_2=0}^{\infty}\cdots\sum_{n_K=0}^{\infty}(n_1+n_2+\ldots+n_K)!\exp\left(i(n_1 x_1+n_2 x_2 +\ldots + n_K x_K)t\right)\prod_{i=1}^{K}\frac{(-c_i)^{n_i}}{n_i!}
$$
Each exponential term averages to $0$ as $T\rightarrow\infty$, unless the weighted sum of the $x$'s in the exponent is zero, in which case the term averages to (indeed, uniformly equals) $1$.  So the form of the result will depend on exactly which sums of the $x$'s vanish.  If none do (except for the trivial sum), the result is $1$.  If $x_1=-x_2$ (and all the other $x_i$ are algebraically independent), then the non-vanishing terms will be those where $n_1=n_2$ (and all the other $n_i=0$), leading to
$$
\sum_{n=0}^{\infty}{{2n}\choose{n}}(c_1 c_2)^n=-1-2c_1c_2+\frac{1}{\sqrt{1-4c_1c_2}}.
$$
And so on, for arbitrarily complicated rational relationships between the $x_i$.
