Four-vector differentiation (E-M Euler-Lagrange eq.) $$\partial_{\mu} \frac{\partial(\partial_{\alpha}A_{\alpha})^2}{\partial(\partial_{\mu}A_{\nu})} = \partial_{\mu}\left[2(\partial_{\alpha}A_{\alpha})\frac{\partial(\partial_{\beta}A_{\gamma})}{\partial(\partial_{\mu}A_{\nu})} g_{\beta\gamma}\right]$$
I assume the metric comes from differentiating a vector wrt to another and chain rule is applied, but I can't see how exactly these two sides are equal.
 A: As mentioned in the OP's link Schwartz (in his QFT book) doesn't keep track of the index placement on tensor objects that might obscure the structure a little.
However, ignoring the first derivative $\partial_\mu$ (because it is not relevant for the answer) the starting point is to distinguish between covariant and contravariant indices such that
$$ (\partial_\alpha A_\alpha)^2 \to (\partial_\alpha A^\alpha)^2=(\partial_\alpha A^\alpha)(\partial_\beta A^\beta)\ .$$
Applying the product rule we see
$$\frac{\partial (\partial_\alpha A^\alpha)(\partial_\beta A^\beta)}{\partial (\partial_\mu A_\nu)}= \frac{\partial (\partial_\alpha A^\alpha)}{\partial (\partial_\mu A_\nu)}(\partial_\beta A^\beta)+(\partial_\alpha A^\alpha)\frac{\partial(\partial_\beta A^\beta)}{\partial (\partial_\mu A_\nu)}\ .$$
Since the indices must be at the right position in order to perform a derivative we can use the metric to write $\partial_\alpha A^\alpha= g^{\alpha\gamma}\partial_\alpha A_\gamma$ similar for the second expression.
Hence, the Euler-Lagrange variation involves a metric
$$\frac{\partial (\partial_\alpha A^\alpha)}{\partial (\partial_\mu A_\nu)}=\frac{\partial (\partial_\alpha A_\gamma)}{\partial (\partial_\mu A_\nu)}g^{\alpha\gamma}\ .$$
Collecting all pieces and replacing the labeling of dummy indices $\alpha \leftrightarrow \beta$ this leads eventually to the result in the brackets
$$\frac{\partial (\partial_\alpha A^\alpha)(\partial_\beta A^\beta)}{\partial (\partial_\mu A_\nu)} = (\partial_\beta A^\beta)\frac{\partial (\partial_\alpha A_\gamma)}{\partial (\partial_\mu A_\nu)}g^{\alpha\gamma}+(\partial_\alpha A^\alpha)\frac{\partial(\partial_\beta A_\gamma)}{\partial (\partial_\mu A_\nu)}g^{\beta \gamma}\\
=(\partial_\alpha A^\alpha)\frac{\partial (\partial_\beta A_\gamma)}{\partial (\partial_\mu A_\nu)}g^{\beta\gamma}+(\partial_\alpha A^\alpha)\frac{\partial(\partial_\beta A_\gamma)}{\partial (\partial_\mu A_\nu)}g^{\beta \gamma}\\
=2 (\partial_\alpha A^\alpha)\frac{\partial (\partial_\beta A_\gamma)}{\partial (\partial_\mu A_\nu)}g^{\beta\gamma}\ .$$
