Solution (source code)

= Solution

Substitution of the gauge transformations and $UU^\dagger=I$ gives
$$
D_\mu'\phi'=U(D_\mu\phi)U^\dagger.
$$
A direct commutator calculation gives
$$
[D_\mu,D_\nu]\phi=-ig[F_{\mu\nu},\phi].
$$
Covariance of the left side then implies $F'_{\mu\nu}=UF_{\mu\nu}U^\dagger$. The <cyclic property of the trace> makes the traces of $F_{\mu\nu}F^{\mu\nu}$, $D_\mu\phi D^\mu\phi$, and $\phi^3$ invariant, so the Lagrangian is <gauge invariance>[gauge invariant].