I have a lot of trouble finding out what the rules are for doing algebra and calculus with 4-vectors. This example shall illustrate one of my problems:
The Lagrangian for a real scalar field is
$$\mathcal{L}=\frac{1}{2}\eta^{\mu\nu}\partial_{\mu}\phi\partial_{\nu}\phi-\frac{1}{2}m^2\phi^2.$$ When trying to solve the Euler-Lagrange equation I do not know how to evaluate $(\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi)})$. These are the ideas I have:
1. $$(\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi)})=\frac{1}{2}\eta^{\mu\nu}\partial_{\nu}\phi=\frac{1}{2}\partial^{\mu}\phi.$$
2. The Lagrangian can be written as $\mathcal{L}=\frac{1}{2}\eta^{\mu\nu}\partial_{\mu}\phi\partial_{\nu}\phi-\frac{1}{2}m^2\phi^2=\frac{1}{2}\partial_{\mu}\phi\partial^{\mu}\phi-\frac{1}{2}m^2\phi^2$, so
$$(\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi)})=\frac{1}{2}\partial^{\mu}\phi.$$
3. But the Lagrangian can also be written as $\mathcal{L}=\frac{1}{2}\partial^{\nu}\phi\partial_{\nu}\phi-\frac{1}{2}m^2\phi^2$, so in this case how do I evaluate it? Do I change $(\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi)})$ to $(\frac{\partial\mathcal{L}}{\partial(\partial_{\nu}\phi)})$?
4. We can write the Lagrangian as $\mathcal{L}=\frac{1}{2}\partial_{\mu}\phi\partial^{\mu}\phi-\frac{1}{2}m^2\phi^2=\frac{1}{2}(\partial_{\mu}\phi)^2-\frac{1}{2}m^2\phi^2$, so in this case we have
$$(\frac{\partial\mathcal{L}}{\partial(\partial_{\mu}\phi)})=\frac{1}{2}2(\partial_{\mu}\phi)=\partial_{\mu}\phi.$$
None of these are correct $(\partial^{\mu}\phi)$! How do I get the correct answer? What am I doing wrong? Are there any resources where they can help me specifically with such problems?