I have a Lagrangian of a form:
$$\mathcal{L}=\frac{1}{2}\left (A_\mu g^{\mu\nu}\partial^2 A_\nu-A_\mu \partial^\mu \partial^\nu A_\nu\right ) $$
And I want to show that it is equivalent to the Lagrangian of a form
$$\mathcal{L}=-\frac{1}{4}(\partial_\mu A_\nu- \partial_\nu A_\mu)(\partial^\mu A^\nu-\partial^\nu A^\mu)$$
I know that the lagrangians are said to be invariant in a sense that they differ by total derivative:
$$\mathrm{d}(AB)=(\mathrm{d}A)B+A(\mathrm{d}B)$$
$$(\mathrm{d}A)B=-A(\mathrm{d}B)+\mathrm{d}(AB)$$
However, I was unsuccessful in my atempts in calculating in that way (tried various scenarios of taking $A$ and $\mathrm{d}B$ from the Lagrangian, but did not succeed). Could anyone help on how to do it the right way?