Squared Summation of Terms using Einstein's summation convention In working with QFT and Maxwell's equations, terms such as:$$\left(\partial_\mu\,A^\mu\right)^{2}$$ often appear.  Since I am new to this, I am not sure of the expansion.  That is, is it 4 terms squared or is it 4 squard terms:
$$\left(\partial_0 A^0\right)^{2} + \left(\partial_1 A^1\right)^{2} +\left(\partial_2 A^{2}\right)^{2} +\left(\partial_3 A^3\right)^{2}$$Or,
$$\left(\partial_0 A^0 + \partial_1 A^1 +\partial_2 A^{2} +\partial_3 A^3\right)^{2}$$
 A: Here, standard rules of algebra should apply, i.e. the summation should be performed first and then squared (it is obvious once you write out the summation symbol instead of using Einstein's notation):
$$(\partial_\mu A^\mu)^2 = \left( \sum_{\mu=0}^3 \partial_\mu A^\mu \right)^2 = (\partial_0 A^0 + \dots)^2$$
Note that expressions using covariant notation (with valid use Einstein's summation convention) are automatically Lorentz-invariant. You can quickly convince yourself that the first expression you propose is no longer covariant.
A: Reference : Squaring the E&M (Maxwell) field strength tensor.
Looking at equation (06) of my answer in above link we realize that this square comes from the expression
\begin{equation}
\left(\partial^{\mu}A_{\mu}\right)\left(\partial_{\nu}A^{\nu}\right)\boldsymbol{=}\left(\partial_{\mu}A^{\mu}\right)\left(\partial_{\nu}A^{\nu}\right)\boldsymbol{=}\left(\partial_{\mu}A^{\mu}\right)^2
\tag{06}\label{06}  
\end{equation}
so is the square of a sum and not the sum of squares.
