I am integrating the following Gaussian over all possible matrix elements $J\_{ij}$:
$$ I=\int \exp{\left\{-a\sum\_{ij}J\_{ij}^2+b\sum\_{ij}J\_{ij}+c\sum\_{ij}J\_{ij}J\_{ji} \right\}} \left (\prod\_{ij}\mathrm{d}J\_{ij} \right)$$


How can I deal with the $\sum\_{ij}J\_{ij}J\_{ji}$ terms? The fact that I am integrating over matrix elements confuses me. Any help or advice is always appreciated, thanks !



How can we do a Gaussian integral over matrix elements?
Decompose the sum over $i,j$ as
$$-a\sum\_{ij}J\_{ij}^2+b\sum\_{ij}J\_{ij}+c\sum\_{ij}J\_{ij}J\_{ji}=$$
$$\qquad\qquad=\sum\_{i}\left[(c-a)J\_{ii}^2+bJ\_{ii}\right]+\sum\_{i<j}\left[-a(J\_{ij}^2+J\_{ji}^2)+b(J\_{ij}+J\_{ji})+2cJ\_{ij}J\_{ji}\right]$$
$$\qquad\qquad\equiv\sum\_{i} A\_i+\sum\_{i<j} B\_{ij}.$$
Then perform the Gaussian integrals separately for each term in the sum (assuming $c<a$ and $c^2/a<a$),
$$I=\left(\prod\_{i=1}^N\int e^{A\_i}dJ\_{ii}\right)\left(\prod\_{i<j=1}^{N}\int\int e^{B\_{ij}}dJ\_{ij}dJ\_{ji}\right)$$
$$\qquad\qquad=\left(\frac{\sqrt{\pi } e^{\frac{b^2}{4 a-4 c}}}{\sqrt{a-c}}\right)^N\left(\frac{\pi e^{\frac{b^2}{2 a-2 c}}}{\sqrt{a^2-c^2}}\right)^{N(N-1)/2}=\pi^{N^2/2}e^{\frac{N^2b^2}{4a-4c}}(a-c)^{-N/2}(a^2-c^2)^{-N(N-1)/2}.$$


