How does this Gaussian integral over the auxiliary field in 2D topological gauge theory work? In "Lectures on 2d Gauge Theories: Topological Aspects and Path Integral Techniques" by Thompson and Blau equation (2.2) reads
$$
\int [DA] \exp\left( \int Tr(F\star F \right) = \int [DA \, D\phi] \exp\left( \int Tr (i \phi F) + \int d\mu Tr \phi^2 \right),\tag{2.2}
$$
where all integrals are over a Riemann surface $\Sigma_g$, $F$ is the field strength of the connection $A$ and $\phi$ is a scalar matrix-valued field. Note I have omitted some constant factors. It is written there that the LHS can be obtained by performing the Gaussian integral over the $\phi$ in the RHS. How exactly does this work? I cannot see how this equality holds. And what is the measure $d \mu$ seen in the RHS?
 A: Hints: 


*

*Spacetime is 2D. Let $\nu:=\star 1$ be a top/volume/area form, which is a closed but not exact 2-form. (It should be identified with the measure $d\mu$ in the paper.)

*Then there exist a Lie algebra-valued scalar function $f$, such that $F=f \nu$.

*The Lagrangian 2-form becomes (up to constant factors)
$$\mathbb{L}~=~{\rm Tr}(F\star F)~=~\nu{\rm Tr}( f^2). \tag{A}$$

*Show that integrating out the Lie algebra-valued scalar field $\phi$ / completing the square on the rhs. of eq. (2.2) yields the same Lagrangian 2-form (A).
A: The volume form on the Riemann surface $\Sigma_g$ is denoted $\mathrm{d}\mu$. Up to $C^\infty$-normalization, it is the unique 2-form on the surface. Since it is unique, we may write $F = f \mathrm{d}\mu$ for some $\mathfrak{g}$-valued function $f$.
The formal path integral over $\phi$ is indeed simply a Gaussian integral: We can write the action of the BF theory on the r.h.s. as
$$ S_\text{BF}[A,\phi] = \int \mathrm{Tr}(\mathrm{i}\phi f + \phi^2)\mathrm{d}\mu = \int \left(\mathrm{Tr}\left(\left(\phi + \frac{\mathrm{i}}{2}f\right)^2\right) + \mathrm{Tr}\left(\frac{1}{4}f^2\right)\right)\mathrm{d}\mu$$
by completing the square. Now, by the formal analogy between the path integral and usual integrals, $\int \mathrm{e}^{-S_\text{BF}[A,\phi]}\mathcal{D}\phi = c \int \mathrm{e}^{-\frac{1}{4}\int\mathrm{Tr}(f^2)\mathrm{d}\mu}\mathcal{D}\phi$, where $c = \int \mathrm{e}^{\int\mathrm{Tr}((\phi+\mathrm{i}f/2)^2)}\mathcal{D}\phi$ is the constant value of the Gaussian integral, which is independent of $f$.
