Misunderstanding of subscript handling in Lagrangian dynamics

I am slowly trying to learn quantum field theory and have a background in mathematics. The book I am using is quantum field theory demystified by McMahon which is a good intro. There are some things i understand and some I don't. specifically at the moment subscripts and summation. On pages 32-33 there is a Lagrangian given by

$$\mathcal L = \frac{1}{2}[(\partial_\mu \phi)^2 - m^2\phi^2]$$

and where we calculate the equations of motion using EL equations. Using EL equations the derivatives for the $$m^2$$ term dissappear and that is ok but when he calculates the derivatives for the kinetic term he shows that

$$\large\frac{\partial \mathcal L }{ \partial [ \partial_{\mu} \phi]} = \frac{1}{2}\frac{\partial}{ \partial [ \partial_{\mu} \phi]} (\partial_{\mu} \phi) g^{\mu\nu} (\partial_{\nu} \phi)$$ $$=g^{\mu\nu}( \partial_{\nu} \phi) + g^{\mu\nu} (\partial_{\mu} \phi) = 2\partial^{\mu} \phi$$

In reading earlier in the book repeated indices are summed over. But if I'm right summing over these three repeated indices should not give the result he has or maybe I'm confused. Can someone explain what he has done here please?

The answer to this is either a typo or he/she has just used poor notation. There is a derivative of a product in there too. But more importantly, using the index in $$\partial_{\mu}$$ and using it as a summation index in the equation for $$\mathcal L$$ is incorrect. You cannot sum two terms that have different free indices. In other words, the summed index on the Lagrangian or the partial derivative should be different.

Let's say we use $$\partial_{\sigma}$$. Then if you like, you can repeat your step above like

$$\frac{\partial \mathcal L}{\partial(\partial_\sigma\phi)}= \frac{\partial}{\partial(\partial_\sigma\phi)}g^{\mu\nu}(\partial_\mu\phi)(\partial_\nu\phi) = g^{\mu\nu}[ \delta_\mu^\sigma \partial_\nu\phi + \delta_\nu^\sigma\partial_\mu\phi]$$

which will give

$$\frac{\partial \mathcal L}{\partial(\partial_\sigma\phi)} = 2\partial^\sigma\phi$$

and because $$\sigma$$ is a dummy index, you can write

$$\frac{\partial \mathcal L}{\partial(\partial_\mu \phi)} = 2\partial^\mu \phi$$

Which is the result you have above. So the answer is correct, but perhaps sloppy notation was used or it's just a typo. I can see by a quick google search that the author above has several introductory books in some relatively complicated fields (like string theory and super symmetry), so I'm inclined to think that this is a just typo.