Good morning/evening.
In Peskin & Schroeder chapter 16 on gauge invariance, the gauge boson self interaction vertex rules are given. For three gauge bosons, the relevant interaction term in the Lagrangian is
$$\mathcal{L}_{YM} \supset g \,f^{ijk}A_{\mu}{}^{(j)} A_{\nu}{}^{(k)} \partial^{\mu} A^{\nu}{}^{(i)} $$
I have rewritten this term using the total asymmetry of the structure constants:
$$ \mathcal{L}_{YM} \supset \dfrac{g}{6} f^{ijk} \left[ A_{\mu}{}^{(j)} A_{\nu}{}^{(k)} \left(\partial^{\mu} A^{\nu}{}^{(i)} - \partial^{\nu} A^{\mu}{}^{(i)}\right) + A_{\mu}{}^{(i)} A_{\nu}{}^{(k)} \left(\partial^{\mu} A^{\nu}{}^{(j)} - \partial^{\nu} A^{\mu}{}^{(j)}\right) + A_{\mu}{}^{(k)} A_{\nu}{}^{(i)} \left(\partial^{\mu} A^{\nu}{}^{(j)} - \partial^{\nu} A^{\mu}{}^{(j)}\right)\right] $$
I know that the derivative of the field will make the momenta appear in the expression. The problem is that I do not understand which gauge field momentum appears from which derivative, and how to go from this expression to the answer, which is
$$ g f^{abc} \left[ g^{\mu \nu} (k-p)^\rho + g^{\nu \rho} (p-q)^\mu + g^{\rho \mu} (q-k)^\nu \right] $$
where the momenta and indices are taken according to the attached diagram.
Thanks in advance for any clarification!