A Question about Yang-Mills Equation The non-homogeneous part of the Yang-Mills equations is given by
$$D\star F=\star J,$$
where $D=d+A$ is the covariant derivative, $\star$ is the Hodge star and $J$ is the source current.
Under a gauge transformation $U(x)$, the above equation should stay invariant. Under a gauge transformation $U(x)$, $D\star F$ is transformed to 
$$D^{\prime}\star F^{\prime},$$
where $F^{\prime}=UFU^{-1}$. One finds 
$$D^{\prime}\star F^{\prime}=U(D\star F)U^{-1}.$$
Thus, if the equation of motion is invariant under the gauge transformation, one expects that the current $J$ should transform as
$$J^{\prime}=UJU^{-1}.$$
However, take the spinor-QCD as an example, the gauge current is given by 
$$J^{a}_{\mu}(x)=\bar{\Psi}\gamma_{\mu}T^{a}\Psi,$$
where $T_{a}$ is the generator of the gauge group. Under a gauge transformation, the spinor transforms as 
$$\Psi^{\prime}(x)=U(x)\Psi(x).$$
It seems to me that this spinor current doesn't transform as expected. 
What is wrong?
 A: To resolve this, we can go back to the derivation of the (classical) equation of motion from the lagrangian. The lagrangian has the form
$$
 L\sim c_F\text{trace}(F_{\mu\nu}F^{\mu\nu})
 + c_\Psi\bar\Psi\gamma_\mu A^\mu\Psi + \cdots
$$
where $c_F$ and $c_\Psi$ are coefficients whose values aren't important here and where terms that don't involve the gauge field $A$ are represented by "$\cdots$". For this question, the important details are:


*

*$F=dA+A\wedge A$ with $A=\sum_a A_a T^a$, where $A_a$ is a one-form and $T^a$ is a generator of the gauge group, which we can think of as a square matrix.

*The trace is over the matrix incides of the gauge group generators $T^a$.

*$\Psi$ is a column matrix in the gauge-group domain. (The spinor index of $\Psi$ is not important here.)
To derive the equation of motion for the gauge field, we take the variation of $L$ with respect to the components $A_{\mu,a}$ of the gauge field. To answer the question, the important detail is that this variation of $A$ with respect to $A_{\mu,a}$ is $dx^\mu T^a$, so the variation leaves the trace intact, with a generator $T^a$ left behind in place of the guage field $A$ in each term where an $A_{\mu,a}$ was removed by the variation. The resulting equation of motion has the form
$$
 \text{trace}(T^a D\star F)\propto \star \bar\Psi\gamma T^a\Psi,
$$
where spacetime indices are buried in the differential-form notation.
The quantity $D\star F$ transforms as stated in the OP, but that quantity is inside the trace, so there is no conflict with the transformation of $J^a$ that follows from $\Psi\to U(x)\Psi$. Neither side of the equation has any free matrix indices, just one free index $a$ specifying a generator of the gauge group. 
If desired, we could "break the trace open" by multiplying both sides of the equation by $T^a$ and summing over $a$.  That gives $D\star F$ on the left-hand side, as in the OP, but it also "breaks open" the matrix product on the right-hand side, giving $\bar\Psi_j\gamma\Psi_k$ where $j,k$ are matrix indices as in $T^a_{jk}$. Now both sides of the equation transform as $X\to UXU^{-1}$.
