I am reading a book on QFT which is stating the following.
For a massless scalar field $\phi$ the simplest possible Lagrangian is given by $$ \mathcal{L}(x) = \frac{1}{2} \partial^\mu\phi \partial_\mu\phi $$ with $\partial_\mu\phi\equiv\partial\phi(x)/ \partial\phi^\mu $. This can be expanded to $\mathcal{L}(x) = \frac{1}{2} (\partial_t\phi)^2 -\frac{1}{2}\nabla\phi\cdot\nabla\phi$. Which I easily see by using the definitions of $\partial^\mu$ and $\partial_\mu$ and having the mixted termes cancelling out each other.
But now the book also states that $$ \mathcal{L}(x) = \frac{1}{2} \partial^\mu\phi \partial_\mu\phi=\frac{1}{2}(\partial_\mu\phi)^2, $$ but I totaly fail to see this relation. To my understanding the expantion of the right part should look like $$ \frac{1}{2}(\partial_\mu\phi)^2= \frac{1}{2} (\partial_t\phi)^2 -\frac{1}{2}\nabla\phi\cdot\nabla\phi+ \partial_t\phi\nabla\phi $$ which is not equal to the given expantion above.
So what is my error?
[edit] Thanks for the comments that $$ (\partial_\mu\phi)^2 \equiv (\partial_{\mu}\phi)g^{\mu\nu}(\partial_{\nu}\phi) $$ And that I should not take the square "seriously". But If I don't take it seriously, how can I later on see that $$ \partial_\mu \left( \frac{\partial\mathcal{L}}{\partial(\partial_\mu\phi)} \right)= \partial_\mu\partial^\mu\phi $$ when using the Euler-Lagrange equation?