Consider the following function $f(x) = \frac{1-a^2}{1+a^2-2a \cos x}$. I'm looking for its represention of this kind: $\sum_{\mathbb{Z}} a_k e^{ikx}$
So we can rewrite function as $f(x) = \frac{1}{1+a^2}\frac{1-a^2}{1-\frac{2a \cos x}{1+a^2}}$ And consider it is as a geometric sequence, with $q=\frac{2a \cos x}{1+a^2} = \frac{a (e^{ix}+e^{-ix})}{1+a^2}$
So the series probally look like: $\sum_{\mathbb{Z}} \left(\frac{a}{1+a^2}\right)^{|k|} e^{ikx}$. Is it correct? Does it work for complex a?
You are dealing with the well-known Fourier series of the Poisson kernel. For any $0\leq r <1$,
$$ P_r(\theta) = \sum_{n\in\mathbb{Z}} r^{|n|}e^{in\theta} = \frac{1-r^2}{1-2r\cos\theta +r^2} = \operatorname{Re}\left(\frac{1+re^{i\theta}}{1-re^{i\theta}}\right)$$ and if $r$ does not belong to the $[0,1)$ interval it is enough to apply the above result to $-r$ or $\pm\frac{1}{r}$.
For any complex $r$ such that $|r|<1$, $\sum_{n\in\mathbb{N}}r^n e^{in\theta}$ is simply a geometric series.