Reading Altland and Simons' "Condensed matter field theory" I am stuck in the exercise called "electron phonon coupling" in section 4.5.
The exercises is about integrating out the phonon fields to get an effective interaction between the fermionic fields. More precisely they write the action of such system as $$ S[\bar{\phi},\phi,\bar{\psi},\psi] = S_{ph}[\bar{\phi},\phi] + S_{el}[\bar{\psi},\psi] + S_{el-ph}[\bar{\phi},\phi,\bar{\psi},\psi], $$ where $S_{el}$ is the electronic non interacting action, which we don't need here, $S_{ph}$ is the free phonons action, and $S_{el-ph}$ is the action of the interaction: $$ S_{ph}[\bar{\phi},\phi] = \sum_{q,j} \bar{\phi}_{qj}( - i\omega_n + \omega_q ) \phi_{qj} $$ $$ S_{el-ph}[\bar{\phi},\phi,\bar{\psi},\psi] = \gamma \sum_{qj} \frac{i \vec{q}\cdot \vec{e}_j}{\sqrt{2m\omega_q}} \sum_{k,\sigma} \bar{\psi}_{k+q,\sigma} \psi_{k\sigma} (\phi_{qj} + \bar{\phi}_{-qj}). $$ Here $\omega_q$ is the phonon dispersion relation, supposed to be dependent on $q$ only and such that $\omega_{-q}=\omega_q$, $j$ labels the phononic branches, $\sigma$ labels the electronic spin, $i\omega_n$ are Matsubara bosonic frequencies, $m$ and $\gamma$ are constants.
So far so good, but now I am asked to integrate out the phonon fields, and I can't do that properly to recover their result for the effective action, which is: $$ S_{eff}[\bar{\psi},\psi] = S_{el}[\bar{\psi},\psi] - \frac{\gamma}{2m} \sum_q \frac{q^2}{\omega_n^2+\omega_q^2} \rho_q\rho_{-q}, $$ where $\rho_q = \sum_{k\sigma} \bar{\psi}_{k+q,\sigma}\psi_{k\sigma}$. My question is basically: do you have any suggestions on how to integrate out these fields? Also, do you think this is the correct result, I mean consistent with the assumptions above? If not can you explain the mistake? Thanks in advance
My attempt
I was thinking about defining the "currents" $$ J_{qj} = \gamma \frac{i \vec{q}\cdot \vec{e}_j}{\sqrt{2m\omega_q}} \rho_q; \;\;\;\;\; K_{qj} = - \gamma \frac{i \vec{q}\cdot \vec{e}_j}{\sqrt{2m\omega_q}} \rho_{-q}, $$ so that the function we have to integrate is $$ \exp\left[-S_{ph}[\bar{\phi},\phi] - \sum_{qj} ( J_{qj} \phi_{qj} + K_{qj} \bar{\phi}_{qj} )\right]. $$ Now this is a gaussian integral, which solution should be proportional to $$ \exp\left[\sum_{qj} \frac{ \bar{J}_{qj} K_{qj} }{-i\omega_n + \omega_q} \right], $$ which leads to a wrong result.