I am currently studying quantum field theory from Srednicki. In class we have covered till chapter 14 and then skipped to IR divergences. So my knowledge of quantum field theory is limited to those sections. I just mentioned it in case it helps you guys to calibrate your responses to my level! Anyways, my question is related to determining vertex factors for any arbitrary interaction. We were introduced to vertex factors in chapter 9. For interacting theories such as: $$\mathcal{L}_I = \frac{g}{3!}\varphi^3$$ and $$\mathcal{L}_I = \frac{\lambda}{4!}\varphi^4$$ the vertex factors are $ig$ and $i\lambda$ respectively. Ignore the sign; I can never remember it. Also, for this discussion it probably won't be a big deal. Anyways, getting back to the main point, I only remember being told that the vertex factors are the ones given above but no one ever told me how they were obtained. Srednicki never formally defined them. I just assumed that you just read off the coefficient from the interacting part. Also, physically I have an intuition for the vertex factor. It represents the strength with which the interactions couple free fields. And when you compute Feynman diagrams more interactions means higher powers of this coupling parameter (or vertex factor).
In some later chapters Srednicki defined this vertex function $V_n(k_1,k_2,\dots,k_n)$; but he only formally talks about it in the context of vertex corrections. For the moment I'm not interested in corrections. I just want to know how you can compute this function for an arbitrary theory (say): $$\mathcal{L}_I = f_n(\varphi,\partial_\mu \varphi)$$ where the subscript $n$ the maximum number of fields and/or their derivatives defined in the function $f_n(\varphi,\partial_\mu \varphi)$. In general the vertex factor will not be just a constant like the two cases above. It will be a function of the incoming and outgoing four-momenta. What recipe should I follow to get that expression?