How to expand Maxwell Lagrangian? I am given $$L=-\frac{1}{4}F^2_{\mu\nu}-A_{\mu\nu}J_\mu$$ to calculate equations of motion I have to expand the terms in the Lagrangian as following (note this is from Schwartz QFT book page 37):
$$L=-\frac{1}{4}(\partial_{\mu}A_\nu -\partial_\nu A_\mu)^2 -A_\mu J_\mu$$ the book then proceeds to get: $$L=-\frac{1}{2}(\partial_\mu A_\nu)^2+\frac{1}{2}(\partial_\mu A_\mu)^2-A_\mu J_\mu$$
but what I get is:
$$L=-\frac{1}{4}[(\partial_\mu A_\nu)^2+(\partial_\nu A_\mu)^2-2(\partial_\mu A_\nu)(\partial_\nu A_\mu)]-A_\mu J_\mu$$ how are these related?
 A: If you write the $F_{\mu\nu}^2$ term in the Lagrangian equivalently as $F_{\mu\nu}F^{\mu\nu}$ you can expand it as $(\partial_\mu A_\nu - \partial_\nu A_\mu)(\partial^\mu A^\nu - \partial^\nu A^\mu)$ which can then be fully multiplied to give $$\partial_\mu A_\nu \partial^\mu A^\nu - \partial_\mu A_\nu \partial^\nu A^\mu -\partial_\nu A_\mu \partial^\mu A^\nu + \partial_\nu A_\mu \partial^\nu A^\mu$$ If you look carefully you can see that the first and last terms are the same because the indices match up and they are summing over the same thing, the same applies for the centre terms. Therefore we can simplify it by writing it as $$2\partial_\mu A_\nu \partial^\mu A^\nu -2 \partial_\mu A_\nu \partial^\nu A^\mu$$ The Lagrangian is then $$\mathcal L = -\frac{1}{2}(\partial_\mu A^\nu)^2 + \frac{1}{2}(\partial_\mu A^\mu)^2 - A_\mu J^\mu$$ The issue with your derivation is that you had all your indices at the bottom like how it's done in your book which can be ambiguous and in this case cause you to be unable to realize that the terms can be simplified.
A: The calculation in the question is correct, but incomplete. We can continue as follows
$$
\begin{align}
L&=-\frac{1}{4}[(\partial_\mu A_\nu)^2+(\partial_\nu A_\mu)^2-2(\partial_\mu A_\nu)(\partial_\nu A_\mu)]-A_\mu J_\mu\tag1\\
&=-\frac{1}{4}[(\partial_\mu A_\nu)^2+(\partial_\mu A_\nu)^2-2(\partial_\mu A_\nu)(\partial_\nu A_\mu)]-A_\mu J_\mu\tag2\\
&=-\frac{1}{2}[(\partial_\mu A_\nu)^2-(\partial_\mu A_\nu)(\partial_\nu A_\mu)]-A_\mu J_\mu\tag3\\
&=-\frac{1}{2}[(\partial_\mu A_\nu)^2+A_\nu(\partial_\mu\partial_\nu A_\mu)]-A_\mu J_\mu\tag4\\
&=-\frac{1}{2}[(\partial_\mu A_\nu)^2+A_\nu(\partial_\nu\partial_\mu A_\mu)]-A_\mu J_\mu\tag5\\
&=-\frac{1}{2}[(\partial_\mu A_\nu)^2-(\partial_\nu A_\nu)(\partial_\mu A_\mu)]-A_\mu J_\mu\tag6\\
&=-\frac{1}{2}[(\partial_\mu A_\nu)^2-(\partial_\mu A_\mu)^2]-A_\mu J_\mu\tag7
\end{align}
$$
in agreement with equation $(3.43)$ in the book.
Renaming dummy indices
The calculation uses two rules. First, we can rename indices bound by a contraction. We used this to go from $(1)$ to $(2)$
$$
(\partial_\nu A_\mu)^2=\partial_\nu A_\mu\partial_\nu A_\mu=\partial_\mu A_\nu\partial_\mu A_\nu=(\partial_\mu A_\nu)^2\tag8
$$
where the two contractions are implicit in the square.
Integration by parts
Second, within a Lagrangian we can perform implicit integration by parts, as stated in $(3.14)$
$$
A\partial_\mu B=-(\partial_\mu A)B\tag9
$$
on page $31$ in the book. We used this to go from $(3)$ to $(4)$ and from $(5)$ to $(6)$.
