### 2.2 The Lagrangian, evolution equations and conserved quantities

The EKG evolution equations can be derived from the action [219]
where is the Ricci scalar of the spacetime represented by the metric , and its determinant
. The term describes the matter, which here is that of a complex scalar field,
where is the complex conjugate of the field and a potential depending only on the
magnitude of the scalar field, consistent with the invariance of the field in the complex
plane.
Variation of the action in Eq. (7) with respect to the metric leads to the well-known Einstein
equations

where is the Ricci tensor and is the real stress-energy tensor. Eqs. (9) form a system of 10
non-linear partial differential equations for the spacetime metric components coupled to the scalar
field via the stress-energy tensor given in Eq. (10).
On the other hand, the variation of the action in Eq. (7) with respect to the scalar field , leads to
the Klein–Gordon (KG) equation

An equivalent equation is obtained when varying the action with respect to the complex conjugate . The
simplest potential leading to boson stars is the so-called free field case, where the potential takes the form
with a parameter that can be identified with the bare mass of the field theory.
According to Noether’s theorem, the invariance of the Klein–Gordon Lagrangian in Eq. (8)
under global U(1) transformations implies the existence of a conserved current

satisfying the conservation law
The spatial integral of the time component of this current defines the conserved Noether charge, given by
which can be associated with the total number of bosonic particles [188].