Path integral & Gaussian integration The following is from Ref. 1.
Given the (Euclidean) action for a particle ($q$) coupled to a bath of harmonic  oscillators $q_\alpha$. Goal is to find an effective action for the particle, e.g integrate out the bath degrees of freedom.
$$ S_{particle} = \int_0^\beta d\tau'\left(\frac{m}{2}(\partial_{\tau'}q)^2+V(q) \right)$$
$$ S_{bath} = \sum_\alpha\frac{m_\alpha}{2}\int_0^\beta d\tau'\left((\partial_{\tau'}q_{\alpha})^2+\omega_\alpha^2q_{\alpha}^2 \right)$$
and coupling
$$ S_c = \sum_\alpha\int_0^\beta d\tau'\left( f_\alpha[q]q_\alpha+\frac{f_\alpha[q]^2}{2m_\alpha\omega_\alpha^2}\right) $$
$f_\alpha$ are some generic functions and the $q$ and $q_\alpha$ obey periodic boundary conditions. My first instinct is switching to frequency space:
$$ S_{bath} = \sum_{\alpha,n} \frac{m_\alpha}{2}q_{\alpha,n}\underbrace{(\omega_n^2+\omega_\alpha^2)}_{A_{n,-n}}q_{\alpha,-n} $$
My problem is 
a) The matrix $A$ is not diagonal and b) the coupling term still reads
$$ S_c = \sum_{\alpha,n} \int_0^\beta d\tau' f_\alpha[q]q_{\alpha,n}\exp(i\omega_n\tau') $$
and I don't know how to get rid of the integration.
Does somebody have a hint on how to perform the gaussian integration?
The effective action should read 
$$ S_{eff} = S_{particle}[q] + \frac{\beta}{2}\sum_{\alpha,n}\frac{\omega_n^2f_\alpha[q(\omega_n)]f_\alpha[q(-\omega_n)]}{m_\alpha\omega_\alpha^2(\omega_\alpha^2+\omega_n^2)} $$
References:


*

*A. Altland and B. Simons, Condensed Matter Field Theory, Second edition (2010), p.130.

 A: First, a notational simplification. I write the particle coordinate as $x = q$. The bath coordinates $q_{\alpha}$ are uncoupled, so the functional integration over the bath coordinates splits into a product of independent integrals. Therefore, it suffices to consider just a single bath coordinate denoted $y = q_{\alpha} $, with frequency $\nu = \omega_{\alpha} $ and mass $m = m_{\alpha} $. At the end we just add together the contributions from each coordinate in the effective action.
Going to frequency space, we expand the coordinate $y$ in Fourier components as
$$ y(\tau) = \sum\limits_k e^{i \omega_k \tau} y_k, \qquad \omega_k = \frac{2\pi k}{\beta}, \quad k \in \mathbb{Z}$$
so that the inverse transformation is 
$$ y_k = \frac{1}{\beta} \int\limits_0^{\beta} e^{-i\omega_k \tau} y(\tau). $$
I denote Fourier components of the coupling function as
$$ f_k = \frac{1}{\beta} \int\limits_0^{\beta} e^{-i\omega_k \tau} f(x(\tau)), $$
which in Altland & Simons is written $f(x(\omega_k))$ by a slight abuse of notation. Note also that $\omega_{-k} = -\omega_k$. The frequency-space action then reads
$$ S_{bath} = \frac{m\beta}{2} \sum\limits_k y_k (\omega_k^2 + \nu^2) y_{-k},$$
$$S_C = \beta\sum\limits_k \left ( f_{-k} y_k + \frac{ f_k f_{-k}}{2 m \nu^2} \right).$$
The second term on the RHS above is called the counter-term, it does not depend on $y$ so we ignore it for the moment and focus on performing the integration.
The integral is of the Gaussian form$^{\ast}$
$$ \int \prod\limits_i \mathrm{d} y_i\, \exp \left[-\frac{1}{2} (y_j A_{jk} y_k + J_k y_k) \right] \propto \exp\left(\frac{1}{2} J_j A^{-1}_{jk} J_k\right), $$
where summation over repeated indices is implied, and we defined
$$ A_{jk} = m\beta (\omega_j^2 + \nu^2)\delta_{j,-k}$$
$$ J_j = \beta f_{-j}, $$
and $A^{-1}_{jk}$ are matrix elements of the inverse of $A$. As Trimok pointed out, the matrix $A_{jk}$ is block diagonal, therefore so is its inverse. Each block of $A_{jk}$ is proportional to the Pauli matrix $\sigma^x$ in the subspace spanned by $\{y_k,y_{-k}\}$. Since $\sigma^x$ is self-inverse, each block of $A_{jk}^{-1}$ is also proportional to $\sigma^x$. Given these considerations we can basically write down the inverse by inspection:
$$ A_{jk}^{-1} = \frac{1}{m\beta} \frac{1}{\omega_j^2 + \nu^2} \delta_{j,-k}.$$
Adding the counterterm back in, we find the effective action (remember the minus sign in the  Euclidean functional measure $Dx \,e^{-S[x]}$)
\begin{align}
S_{eff} & = S_{particle}[x] + \frac{\beta}{2m}\sum\limits_k f_k f_{-k} \left(\frac{1}{\nu^2} - \frac{1}{\omega_k^2 + \nu^2} \right) \nonumber \\ & = S_{particle}[x] + \frac{\beta}{2m}\sum\limits_k\frac{\omega_k^2\, f_k f_{-k}}{\nu^2(\omega_k^2 + \nu^2)}. \end{align}
$^{\ast}$ I have ignored the fluctuation determinant $\det(A)^{-1/2}$ that also results from the integration over bath coordinates. This factor is independent of $x$, and thus does not affect any observables for the particle only.
