# Variations of actions of (lie algebra valued) differential forms

I have always found it a bit difficult to understand the variation of an action written in differential form language. For example, take the action

$$\int tr A\wedge A\wedge A$$

where $A=A_\mu dx^\mu=A^I_\mu T_I dx^\mu$ is a one form valued in some Lie algebra (this is basically one part of a chern simons action). Now the variation is supposed to give the equations of motion $A\wedge A=0$, however, this is far from trivial to me. If I write it out I get

$$\int A^I_\mu A^J_\nu A^K_\rho tr(T_I T_J T_K) dx^\mu\wedge dx^\nu \wedge dx^\rho$$

Now I suppose I want to vary with respect to the $A_\mu^I$ to get something like

$$\int 3(dA^I_\mu) A^J_\nu A^K_\rho tr(T_I T_J T_K) dx^\mu\wedge dx^\nu \wedge dx^\rho$$

It is still far from trivial to me what this means. We can try to write it as a normal integral by using $dx^\mu\wedge dx^\nu \wedge dx^\rho\sim \epsilon^{\mu\nu\rho} dx^3$ to obtain the following equations of motion

$$\epsilon^{\mu\nu\rho}A^J_\nu A^K_\rho tr(T_I T_J T_K)=0\Rightarrow A_\nu^J A_\mu^K tr (T_I T_L c_{JK}^L)=0$$

where the $c$ are the structure constants. Now the trace should define a non-degenerate bilinear form $tr(T_IT_J)=g_{IJ}$, and from this one can indeed find that $A_\nu^J A_\mu^K c_{JK}^L=0$ which indeed is equivalent to $A\wedge A=0$. (I think this calculation is correct but corrections are welcome)

However I find this derivation very cumbersome and complicated to derive such an "obvious" result. So how should I think of variations of actions written with differential forms? what are the rules for doing such variations?

When we are talking about a variation of $A$, what we mean is that we take a smooth, one-parameter family of $A$s, let's call them $A_\varepsilon$, such that $A_0=A$. Then $\delta=d/d\varepsilon|_{\varepsilon=0}$.
Now then $$\delta\int\mathrm{tr}(A\wedge A\wedge A)=\int\delta\mathrm{tr}(A\wedge A\wedge A)=\\ =\int\mathrm{tr}(\delta A\wedge A\wedge A+A\wedge\delta A\wedge A+A\wedge A\wedge\delta A)=\\ =\int\mathrm{tr}(A\wedge A\wedge\delta A)=0,$$ we reduced from three terms to one because rearranging the wedges, two of the terms are equivalent, and one is the negative of the others. Since this must be true for arbitrary $\delta A$ variations, this implies that $A\wedge A=0$.