Gauge Invariance of the Non-abelian Chern-Simons Term I'm trying to prove that, under the gauge transformation $$A_{\mu} \rightarrow A_{\mu}^{\prime} = g^{-1} A_{\mu} g + g^{-1} \partial_{\mu} g,$$ the non-abelian Chern-Simons Lagrangian density:
$$\mathcal{L}_{CS} = \kappa \epsilon^{\mu \nu \rho} tr \left( A_{\mu} \partial_{\nu}A_{\rho} + \dfrac{2}{3} A_{\mu}A_{\nu}A_{\rho}  \right)$$
becomes:
$$\mathcal{L}_{CS} ~\longrightarrow~ \mathcal{L}_{CS} -  \kappa \epsilon^{\mu \nu \rho} \partial_{\mu} tr \left( \partial_{\nu} g g^{-1} A_{\rho} \right) - \dfrac{\kappa}{3} \epsilon^{\mu \nu \rho} tr \left( g^{-1} \partial_{\mu} g g^{-1} \partial_{\nu} g  g^{-1} \partial_{\rho} g \right)$$ 
as stated in Gerald V. Dunne's lecture notes 'Aspects of Chern-Simons Theory' pages 15-16. 
The second term in the last equation can be disregarded as it's a total derivative and the third term can be shown to be some integer multiple of $2\pi$ provided $\kappa$ is an integer.
Now I understand that gauge invariance of the CS-term can be proven using some clever reasoning (see: Gauge invariant Chern-Simons Lagrangian). However I want to show how we can arrive at the second equation above using the `brute force' method of plugging in the gauge transformed vector field into the Lagrangian. Unfortunately I get stuck with a large number of terms that I'm not sure how to combine or cancel. 
Does anyone know of a source that goes through the above calculation in more detail, or does anyone have any tips for how to proceed. I've done a rather extensive search and can't find any sources that show some of the steps. I already tried using the cyclic properties of the trace and the cancelation of any symmetric term with the anti-symmetric $\epsilon^{\mu \nu \rho}$.  
Thank you in advance for any suggestions.
 A: Consider the Chern-Simons Lagrangian density
$$
\mathcal{L}_{CS} = \kappa \varepsilon^{\mu\nu\rho} \text{Tr}\left(A_\mu \partial_\nu A_\rho + \frac{2}{3} A_\mu A_\nu A_\rho \right)
$$
under the gauge transformation
$$
A_\mu \to g^{-1} A_\mu g + g^{-1} \partial_\mu g \,.
$$
To derive the gauge transformation let us consider both terms separatly. You need to use the cyclic property of the trace, the anti-symmetry of the Levi-Civita tensor and the product rule
$$
\partial_\mu g^{-1}g = \partial_{\mu}(g^{-1}g) - g^{-1}\partial_\mu g = -g^{-1}\partial_\mu g
$$
to get the result. I am not going to give the detailed path of the calculation but I can give some steps in between s.t. you can check your calculations for mistakes. For the first term you should obtain
$$
\varepsilon^{\mu\nu\rho}\text{Tr}\left(\frac{2}{3}A_\mu A_\nu A_\rho\right) \to \varepsilon^{\mu\nu\rho}\left[\frac{2}{3}\text{Tr}(A_\mu A_\nu A_\rho) + \frac{2}{3}\text{Tr}(g^{-1}\partial_\mu g g^{-1} \partial_\nu g g^{-1} \partial_\rho g) \\
 + 2\text{Tr}(A_\mu A_\nu \partial_\rho g g^{-1}) - 2\text{Tr}(A_\mu \partial_\nu g \partial_\rho g^{-1})
\right]
$$
For the second one you get
$$
\varepsilon^{\mu\nu\rho}\text{Tr}(A_\mu \partial_\nu A_\rho) \to \varepsilon^{\mu\nu\rho} \left[\text{Tr}(A_\mu \partial_\nu A_\rho) - 2\text{Tr}(A_\mu A_\nu \partial_\rho g g^{-1}) + 3\text{Tr}(A_\mu \partial_\nu g \partial_\rho g^{-1}) \\ + \text{Tr}(\partial_\mu A_\nu \partial_\rho g g^{-1}) + \text{Tr}(g^{-1}\partial_\mu g \partial_\nu g \partial_\rho g^{-1}) \right]
$$
Combining both results returns (some terms cancel out directly)
\begin{align}
\mathcal{L}_{CS} & \to \mathcal{L}_{CS} + \kappa \varepsilon^{\mu\nu\rho} \left[
\text{Tr}(A_\mu \partial_\nu g \partial_\rho g^{-1}) + \text{Tr}(\partial_\mu A_\nu \partial_\rho g g^{-1}) + \text{Tr}(g^{-1} \partial_\mu g \partial_\nu g^{-1} \partial_\rho g) \\ + \frac{2}{3}\text{Tr}(g^{-1} \partial_\mu g g^{-1} \partial_\nu g g^{-1} \partial_\rho g)
 \right] \\
& = \mathcal{L}_{CS} + \kappa \varepsilon^{\mu\nu\rho} \left[ \text{Tr}((\partial_\mu g^{-1} A_\nu + g^{-1} \partial_\mu A_\nu) \partial_\rho g) + \text{Tr}(g^{-1} \partial_\mu g \partial_\nu g^{-1} \partial_\rho g) \\ - \frac{2}{3} \text{Tr}(g^{-1} \partial_\mu g \partial_\nu g^{-1} \partial_\rho g) \right] \\
& = \mathcal{L}_{CS} + \kappa \varepsilon^{\mu\nu\rho} \left[ \text{Tr}(\partial_\mu( g^{-1} A_\nu) \partial_\rho g) + \frac{1}{3} \text{Tr}(g^{-1} \partial_\mu g \partial_\nu g^{-1} \partial_\rho g) \right] \\
& = \mathcal{L}_{CS} + \kappa \varepsilon^{\mu\nu\rho} \left[ \partial_\mu\text{Tr}(g^{-1} A_\nu \partial_\rho g) - \frac{1}{3} \text{Tr}(g^{-1} \partial_\mu g g^{-1} \partial_\nu g g^{-1} \partial_\rho g) \right] \\
& = \mathcal{L}_{CS} - \kappa \varepsilon^{\mu\nu\rho} \partial_\mu\text{Tr}(\partial_\nu g g^{-1} A_\rho) - \varepsilon^{\mu\nu\rho} \frac{\kappa}{3} \text{Tr}(g^{-1} \partial_\mu g g^{-1} \partial_\nu g g^{-1} \partial_\rho g)
\end{align}
So we get the same result as in "Aspects of Chern-Simons Theory",
Gerald V. Dunne.
