A toy model in 0-d QFT
Draw a point from which $r$ lines emanate (a "vertex"). The ends of the lines are associated with the derivatives. Now let the derivatives act. Two things can happen:
a.) The derivative acts on the exponential. Represent this by attaching a dot to the end of the line (now the derivative is gone, but there's a factor $Y$ associated with the end of the line, symbolized by the dot).
b.) The derivative acts on one of the dots, i.e., one of the $Y$ prefactors you've generated by previous applications of derivatives. Represent this by attaching the line you're considering to one of the dots at the end of another line, erasing the dot (that factor $Y$ is now gone, having acted with the derivative) - so altogether you now have a loop emanating from the vertex and going back into it.
Finally, set $Y=0$. This means that all diagrams which still have dots are erased.
So, your combinatorial problem is to find all different diagrams you can construct this way; in effect, in your example, pairing off lines emanating from the vertex to form loops. There are some numerical factors to take care of, here, just the factors 2 from taking derivatives of $Y^2 $.
In the exponential, you can think of the $Y^2 $ as two dots connected by a line - then this incorporates a.) into the notion used in b.) of "derivatives erasing dots". And you can incorporate the aforementioned factors 2 this way - you have a choice of which dot you're attaching and erasing.
Although it might be a bit facile of me to say, since I'm familiar with the physics parlance, don't be afraid of trying to understand the physics tutorials on this. As far as these diagrammatics go, you don't need to understand the physics behind "propagators", "vertices" and the like. You just need a rudimentary dictionary of what these things are in the graphs. I already mentioned "vertex". "Propagators" are just the lines. The dots are "sources". When you connect two lines, erasing the dot, you're "contracting" ...
So let's complete the exercise: Of course, for odd $r$, the result is zero - there are no valid diagrams. For even $r$, there are $r!/(2^{r/2} (r/2)!)$ ways of pairing off lines coming from the vertex. Multiplied by a factor $2^{r/2} $ from taking $r/2$ derivatives of the exponential, as mentioned above, yields $r!/(r/2)!$. As a check, these are indeed the absolute values of the constant terms in the Hermite polynomials $H_r $.
Here is how I understand the appearance of diagrams in computing that integral, which may not be how the book does it.
We can formally expand as a series in $\epsilon$ and write $$\int_{-\infty}^\infty dX\,e^{-S(X)} = \sum_{n \ge 0} \frac{(-i\epsilon)^n}{ n!} \int_{-\infty}^\infty dX\,e^{-\frac{1}{2}X^2}X^{3n}$$ so the problem reduces to computing the integral on the RHS. This is somewhat well-known to vanish for odd $n$ and to be equal to $\sqrt{2\pi}$ times the double factorial $$(3n - 1)!! = (3n - 1) (3n - 3) \cdots 1$$ when $n$ is even.
Combinatorially, the double factorial counts perfect matchings (partitions into blocks of size 2) of a set of size $3n$. Given a perfect matching of the set $\{1, \dots, 3n\}$, we can construct a $3$-regular graph as follows:
- The vertices are $\{1, \dots, n\}$.
- To each vertex $j$, attach three "half-edges" labelled $\{3j-2, 3j-1, 3j\}$.
- Join half-edges together according to the perfect matching to form edges.
Thus we can interpret the coefficient of $\epsilon^n$ as counting cubic graphs of size $n$. (Though the way we've labelled the half-edges means there is some overcounting to deal with.) Thinking of it this way might not seem very motivated, but for slightly more complicated integrals the benefit is easier to see. For instance, if we added an $\epsilon^4$ term as well, we'd get something counting graphs where vertices can have either degree 3 or 4. The Isserlis–Wick theorem is the generalization of that "well-known" fact about double factorials to the multivariate setting, and can be used to interpret multivariate integrals of this type as counting graphs with decorated edges.