Why are the Euler-Lagrange equations invariant if we add a surface term to the action? In the lecture on Noether's theorem and the Lagrange formulation of classical field theories, my professor wrote

A symmetry is a field variation that maps solutions to solutions, which is true if the action does not change under the variation. Because the Euler-Lagrange equations do not change if we add a surface term to the action, a symmetry can also be obtained by adding a surface term
  $$
\mathcal{L}(x) \mapsto \mathcal{L}(x) + \alpha\partial_\mu \mathcal{J}^\mu(x)
 $$

$\mathcal{L}$ is the Lagrange density and $\alpha$ the infinitesimal parameter of the variation.
I understand that if we add a surface term to $\mathcal{L}$, then we can use the divergence theorem to convert it to $\alpha\partial_\mu\mathcal{J}^\mu(x)$.
But why don't the Euler-Lagrange equations change under a surface term?
 A: Well, if you have a term like $\partial_\mu \mathcal{J}^\mu$, the divergence theorem lets you convert it into a surface term upon integrating to find the action, and since variations are assumed to vanish at the boundary, this term goes away. The Euler-Lagrange equations don't change because they come from setting the variation of the action to zero.
Example: Suppose you have a lagrangian $\mathcal{L}_0$ and add a divergence to get $\mathcal{L} = \mathcal{L}_0 + \partial_\mu \mathcal{J}^\mu$. Recall that the action is (in your favorite number of dimensions):
$$S = \int dx\ \mathcal{L} = S_0 + \int dx\ \partial_\mu \mathcal{J}^\mu = S_0 + \int dS\ n_\mu \mathcal{J}^\mu$$
Here S_0 is the integral of $\mathcal{L}_0$, and $n^\mu$ the normal vector to your boundary. 
The equations of motion are the condition that $\delta S = 0$ to first order whenever we make a variation in $\mathcal{L}$. So:
$$\delta S = \delta S_0 + \int dS\ n_\mu \delta(\mathcal{J}^\mu)$$
But $\mathcal{J}^\mu$ is constructed out of the fields for which you want the equations of motion. Since by hypothesis the variation of the fields at the boundary is zero, so is the variation of $\mathcal{J}^\mu$. The last term vanishes, and we get $\delta S = \delta S_0$. This implies that the e.o.m. don't change, since $\delta S = 0$ is equivalent to $\delta S_0 = 0$.
