Recovering all of Maxwell's equations from the variational principle Whether you can get the first couple of Maxwell equations from a variational principle? In the second volume of the Landau theoretical physics said that it is impossible.
 A: The Maxwell Lagrangian is given by,
$$\mathcal{L}=-\frac{1}{4}F_{\mu\nu}F^{\mu\nu}$$
where $F_{\mu\nu}$ is the field-strength of the gauge field, or alternatively may be interpreted as the curvature of a $U(1)$ Lie algebra valued connection, $A_{\mu}$. By applying the variational principle we obtain,
$$\partial_\mu F^{\mu\nu}=0$$
in vacuum. In terms of the electric and magnetic fields,
$$\nabla \cdot \vec{E}=0 \quad \quad \partial_t \vec{E}=\nabla \times \vec{B}$$
we recover two of Maxwell's equations. Notice, in differential form language, $F=dA$, i.e. the curvature is an exact form, and all exact forms are also closed under the operation of exterior differentiation, i.e.
$$dF=d^2 A=0$$
Converting the above expression to a tensor equation, using the standard definition,
$$d\omega^{(n)}_{a_1 \dots a_n}=\frac{1}{n!} \left( \partial_{[a_1} \omega_{\dots a_n]}\right)$$
recovers the tensor form of the Bianchi identity,
$$\partial_\lambda F_{\mu\nu}+\partial_\mu F_{\nu\lambda}+\partial_\nu F_{\lambda\mu}=0$$
from which the two remaining Maxwell equations follow:
$$\nabla \cdot \vec{B}=0\quad \quad \partial_t \vec{B}=-\nabla\times \vec{E}$$

Recall, given the spin connection $\omega$, by Cartan's second structure equation, the curvature form is,
$$\mathcal{R}=d\omega + \omega \wedge \omega$$
However, the Lie group $U(1)$ is Abelian, and the structure constants vanish, hence the above simplifies,
$$\mathcal{R}=d\omega$$
which is completely analogous to the definition of the electromagnetic field strength. Other gauge groups may not possess the same field-strength. For example, in quantum chromodynamics, $SU(3)$ is non-Abelian, and the extra term does not vanish; in tensor form:
$$G_{\mu\nu}^a=\partial_\mu A^a_\nu - \partial_\nu A^a_\mu + gf^{a}_{bc}A^{b}_\mu A^{c}_\nu$$
