Integrating the gauge covariant derivative by parts I was watching a set of lectures on effective field theory and the lecturer said that you can always integrate the covariant derivative by parts due to gauge symmetry. For example, if I understand correctly, we can write:
\begin{equation} 
\int {\cal D} \phi \exp \left\{ i \int d ^4 x D _\mu \phi D ^\mu \phi + \, ...\right\}  = \int {\cal D} \phi \exp \left\{ i \int d ^4 x  - \phi D ^2  \phi + \,...\right\} 
\end{equation} 
where $D_\mu = \partial_\mu + i g T ^a G_{a, \mu} $. This would be obvious if we didn't have the gauge boson contribution but why does integration by parts hold for the covariant derivative?
 A: Leibniz rule holds for covariant derivatives, both in gauge theories and gravity. Mathematically, a derivation is one for which the Leibniz rule holds. How does it work for non-abelian covariant derivatives. I will give you an example. 
Let $\Phi^\dagger \Phi$ be invariant under local non-abelian gauge transformations. Then
$$
\partial_\mu (\Phi^\dagger \Phi) = (D_\mu\Phi)^\dagger \Phi + \Phi^\dagger (D_\mu\Phi) = [D_\mu(\Phi^\dagger)]\ \Phi + \Phi^\dagger (D_\mu\Phi)
$$
The term on the left hand side is the ordinary derivative as the combination is gauge invariant. By construction, it is easy to see that each term on the right hand side is invariant under local gauge transformation. You need to further show that the terms linear in the gauge field cancel. That more or less follows from representation theory. It is also easy to work out the rules for integrating by parts using the above formula. For your Lagrangian, you would consider the ordinary derivative of the scalar,i.e,, $\partial_\mu (\Phi^\dagger D^\mu \Phi)$.
Remarks: 


*

*The ordinary derivative satisfies an additional property i.e., $\partial_\mu\partial_\nu\ f(x) = \partial_\nu \partial_\mu f(x)$ for all smooth functions. This is not assumed for all derivations. In fact, the obstruction to commutativity of the derivatives defines the field strength.
$$
[D_\mu,D_\nu]\ \Phi \sim g\ (F_{\mu\nu}^a T_a)\ \Phi\ .
$$

*In supersymmetry, one uses a graded version of the Leibniz rule for (covariant) derivatives involving Grassmann coordinates.

A: Because $T^{a}$, which is a generator of the symmetry group is a matrix, the following identity is immediate:
$$[T^{a},BC]=[T^{a},B]C+B[T^{a},C]$$
As you may notice, this is just the Leibniz rule. 
Now consider $$D_{\mu}(BC)=\partial_{\mu}(BC)+[A,BC]$$
It follows that the covariant derivative $D$ obeys the Leibniz Rule. 
