# Grand canonical ensemble of a $d$-dimensional
Reissner-Nordström black hole in a cavity

Tiago V. Fernandes  Centro de Astrofísica e Gravitação - CENTRA, Departamento
de Física, Instituto Superior Técnico - IST, Universidade de Lisboa - UL,
Avenida Rovisco Pais 1, 1049-001 Lisboa, Portugal  José P. S. Lemos  Centro de
Astrofísica e Gravitação - CENTRA, Departamento de Física, Instituto Superior
Técnico - IST, Universidade de Lisboa - UL,
Avenida Rovisco Pais 1, 1049-001 Lisboa, Portugal

###### Abstract

The grand canonical ensemble of a $d$-dimensional Reissner-Nordström black
hole space in a cavity is analyzed in every possible aspect. The analysis
starts with the realization of the grand canonical ensemble through the
Euclidean path integral approach by giving the Euclidean action for the
$d$-dimensional Reissner-Nordström black hole with the correct topology, and
boundary conditions corresponding to a cavity. More precisely, the fixed
quantities of the ensemble are the temperature and the electric potential at
the cavity boundary. One then performs a zero loop approximation, to find and
analyze the stationary points of the reduced action. This yields two solutions
for the electrically charged black hole, the smaller, $r_{+1}$, and the
larger, $r_{+2}$. Through perturbations of the reduced action around the
stationary points, one finds stability criteria for the solutions of the black
hole that show that $r_{+1}$ is unstable and $r_{+2}$ is stable. Moreover, one
analyzes the most probable configurations for each value of the fixed
quantities at the boundary, with the configurations being either a stable
charged black hole or hot flat space. One also compares the stable black hole
with a nongravitating charged shell, which serves as a model for an
electrically charged hot flat space. By making the correspondence between the
action already evaluated and the grand canonical ensemble potential of
thermodynamics one can get the entropy, the mean charge, the mean energy, and
the thermodynamic pressure, as well as the Smarr formula, here shown to be
valid only for the unstable black hole $r_{+1}$. We make a stability analysis
in terms of thermodynamic variables, which yields that thermodynamic stability
is related to the positivity of the heat capacity at constant electric
potential and constant area of the cavity. We also comment on the most
favorable thermodynamic phases and deduce the possible phase transitions. We
then pick up a specific dimension, $d=5$, which is singled out naturally from
the other higher dimensions as it provides an exact solution for the problem,
and apply all the results previously found. The case $d=4$ is concisely put in
an appendix where the results are directly equated with previous works. We
also compare thermodynamic radii with the photonic orbit radius and the
Buchdahl-Andréasson-Wright bound radius in $d$-dimensional Reissner-Nordström
spacetimes and find they are unconnected, showing that the connections
displayed in the Schwarzschild case are not generic, rather they are very
restricted equalities holding only in the pure gravitational situation.

black holes, Euclidean path integral, grand canonical ensemble, thermodynamics

††preprint: APS/123-QED

##  I Introduction

Black hole thermodynamics has been studied since the hypothesis of Bekenstein
that a black hole has entropy Bekenstein:1973 , and since the four laws of
black hole mechanics have been introduced Bardeen:1973 . It was put on a firm
ground after Hawking discovered that black holes radiate field quanta with a
thermal spectrum at temperature $T_{\rm H}=\frac{\kappa}{2\pi}$, the Hawking
temperature in Planck units, where $\kappa$ is the usual black hole surface
gravity Hawking:1975 . Moreover, through path integral methods, it was shown
that the correct vacuum state that sits at the black hole horizon and enables
the radiation to be produced is the Hartle-Hawking vacuum state Hartle:1976 .
Taking all these results together, it was possible to deduce that a black hole
is indeed a thermodynamic object with entropy $S=\frac{A_{+}}{4}$, the
Bekenstein-Hawking entropy, where $A_{+}$ is the black hole horizon area.

A proper construction of the thermodynamics of a black hole can be done by
building a statistical ensemble for the space under analysis. In the canonical
and grand canonical ensembles one has to find the partition function $Z$ of
the corresponding space. A powerful approach to find $Z$ is the Euclidean path
integral approach to quantum gravity. With this method one finds that the
partition function of the space under analysis is given by the path integral
over the possible Euclidean metrics $g$ and fields $\phi$ of the Euclidean
action $I[g,\phi]$, with the restriction that the space and the fields are
periodic with imaginary time length at the boundary being the inverse
temperature, i.e., $Z=\int Dg\,D\phi\,\,{\rm e}^{-I[g,\phi]}$. To make
progress in the computation of the partition function, one can use a zero loop
approximation, where the only contribution to the path integral is the
configuration which minimizes the action $I$ with respect to the relevant
parameters. This action is the classical action and the partition function is
then $Z={\rm e}^{-I}$. In spite of $Z$ being constituted by the classical
action alone in this approximation, it vanishes in the classical limit, i.e.,
it disappears when the Planck constant goes to zero. Thus, the partition
function $Z$ still has a quantum gravitational character, indeed one is
dealing with the semiclassical approximation. The partition function of the
canonical or grand canonical ensembles can then be related to the
thermodynamic canonical or grand canonical potential and the thermodynamics of
the space and fields can be worked out. These ideas were applied with some
success to the Schwarzschild and Reissner-Nordström black holes in which the
canonical and grand canonical ensembles, respectively, were formulated with
heat reservoir boundaries with infinite radius, i.e., at infinity GH77 .
There, it was shown that the configuration which corresponds to a stationary
point of $I$ consisted in a black hole with Hawking temperature and
Bekenstein-Hawking entropy. However, it was also shown that, at least for the
Schwarzschild black hole, the zero loop approximation is not valid, since this
configuration has negative heat capacity, indeed it is an extremum that does
not minimize the action $I$. In fact, in this set up the Schwarzschild
solution corresponds to a saddle point of $I$ and thus acts as an instanton to
hot flat space Gross:1982 . Remarkably, it was later found that if the
boundary, at which a temperature is defined, was put at a finite radius,
specifically, at a radius less or equal to the circular photon orbit radius,
then the instability would disappear allen .

York York:1986  then realized that a black hole space in a spherical cavity at
finite radius attached to a heat reservoir at finite temperature was the
correct setup to construct the canonical or grand canonical ensembles, and
through the path integral approach it was possible to obtain sensible results.
In this scheme, for the Schwarzschild black hole there are two stationary
points of the action $I$. The one which has the least mass is unstable and
corresponds to the Gibbons-Hawking black hole when the radius of the cavity
tends to infinity. The other, which has the highest mass, is stable. Further
developments to understand the Schwarzschild black hole geometry in the
quantum gravity context of York’s formalism were performed in whitingyork ,
the inclusion of matter fields within the formalism was sketched in
Martinez:1989 , and the relation between the various statistical physics
ensembles was studied in bcmmwhitingyork . Using York’s formalism, the grand
canonical ensemble of a Reissner-Nordström black hole in a cavity, where the
temperature and the electric potential are specified at the boundary, was
obtained in Braden:1990 . An important development was achieved in
Zaslavskii:1990  where the canonical ensemble for arbitrary configurations of
self-gravitating systems was analyzed. In general relativistic asymptotically
anti-de Sitter spacetimes with black holes, the canonical ensemble was studied
in three and four dimensions browcreima , in the two-dimensional Teitelboim-
Jackiw theory the corresponding asymptotically anti-de Sitter black hole was
analyzed in the canonical ensemble lemos1996 , and the grand canonical
ensemble of the anti-de Sitter Reissner-Nordström black hole in four
dimensions in general relativity was put forward in Peca:1999 . Several
studies in higher dimensions have also been performed. Indeed, the stability
and the negative mode for a higher-dimensional Schwarzschild black hole in a
finite cavity was studied in gregoryross , the canonical ensemble of
Schwarzschild-anti-de Sitter black holes was done in Akbar:2010 , the $d=5$
and generic $d$ Schwarzschild black holes were analyzed in Andre:2020 ;
Andre:2021 . Gravastars in the canonical ensemble were studied in miyashita .
The Euclidean path integral approach had its domain of study extended from
black holes to black branes. For instance, it has been conjectured that the
mechanical stability of black branes is interwoven with their local
thermodynamic stability Gubser:2001 . This conjecture has been analyzed and
proved in certain cases, see Reall:2001 ; Miyamoto:2007 ; collingbourne .

It is worth noting that there are similarities in York’s formalism and the
analysis of the thermodynamics of a hot thin shell of matter. This has been
established for thin shells with an outer Schwarzschild spacetime in
Martinez:1996  and for thin shells with an outer Reissner-Nordström spacetime
Lemos:2015a . Hot thin shells were then studied in higher dimensions in a
Schwarzschild-Tangherlini spacetime in Andre:2019  and in a Reissner-
Nordström-Tangherlini spacetime in Fernandes:2022 . The Reissner-Nordström
case has been revisited in bergliaffa2 .

In this work, we generalize the work in Braden:1990  for an arbitrary number
of dimensions, and we generalize the work in Andre:2020 ; Andre:2021  by
including electric charge. Thus, we construct the grand canonical ensemble of
a Reissner-Nordström space in a cavity for an arbitrary number of dimensions
$d$. We compute the two possible solutions and analyze their stability, by
looking at the reduced Euclidean action. We obtain the thermodynamic
properties of the stable solution and comment about the similarities between
this treatment and the analysis of the thermodynamics of a charged spherical
thin shell in an arbitrary number of dimensions. We also compare the important
thermodynamic radii that arise in the grand canonical ensemble with the
photonic orbit radius and the Buchdahl-Andréasson-Wright bound radius
Wright:2015  of $d$-dimensional Reissner-Nordström spacetimes to confirm or
dispel some coincidences. In the thermodynamic investigation of stability we
use the analysis set in reif .

This paper is organized as follows. In Sec. II, we describe the path integral
approach and apply it to the $d$-dimensional Reissner-Nordström black hole
space in a cavity, stipulating the statistical mechanics grand canonical
partition function $Z$ which is found from the path integral of the action
$I$. In Sec. III, we perform the zero loop approximation and obtain the
reduced action, the stationary points of the reduced action, make a stability
analysis, and look for the most probable configurations. In Sec. IV, we study
the system as a grand canonical thermodynamic system, provide the connection
between the grand canonical potential and the statistical mechanics grand
canonical partition function $Z$ found from the action $I$ of the path
integral, analyze the thermodynamic quantities and relations, perform a
stability analysis in terms of thermodynamic variables, and look for the most
favorable thermodynamic phase and phase transitions. In Sec. V, we apply the
analysis to the case of $d=5$, which possesses an explicit exact formula for
the stationary points, and we study in detail the zero loop approximation and
the thermodynamics with plots. In Sec. VI, we present the conclusions and
further discussions. There are several appendices which supplement the
analysis of the paper. In the Appendix A, we study the photonic orbit radius
and the Buchdahl-Andréasson-Wright bound in $d$-dimensional Reissner-Nordström
spacetime to compare with the grand canonical ensemble featured radii. In the
Appendix B, we study the smoothness of the critical points, namely, hot flat
space and extremal black hole. In the Appendix C, we make further comparisons
between the grand canonical ensemble of statistical mechanics and the grand
potential of thermodynamics. In the Appendix D, we apply to the case of $d=4$
and compare with the results of previous works. In the Appendix E, we derive
the null geodesic sphere, i.e., the circular photon orbit radius, in the
Reissner-Nordström geometry, giving its value in terms of the horizon radius,
the electric potential there, and the spacetime dimension, so that we can
compare it to the thermodynamic radii. We assume natural units, i.e., $G=1$,
$c=1$, and $\hbar=1$.

##  II Grand canonical ensemble through the path integral approach

###  II.1 The path integral and thermodynamics

Assume a system comprised of a $d$-dimensional spacetime $\mathcal{M}$ with
associated metric $\bm{g}$ and Maxwell vector field $\bm{A}$. The spacetime
$\mathcal{M}$ can be foliated by the history of a spacelike hypersurface
$\Sigma_{t}$ with induced metric $\bm{h}$, where $t$ is the parameter of a
congruence of timelike curves that intersect $\Sigma_{t}$. We can consider
also that each $\Sigma_{t}$ has a boundary $\partial\Sigma_{t}$, and we can
build the history of $\partial\Sigma_{t}$, which we denominate $\mathcal{B}$,
with an induced metric $\bm{\gamma}$. The path integral approach states that
the evolution of the system from one state to another is given by the path
integral $\int D[\bm{g}]D[\bm{A}]{\rm e}^{iI_{L}[\bm{g},\bm{A}]}$, where
$I_{L}[\bm{g},\bm{A}]$ is the Lorentzian action.

The Euclidean path integral approach of gravitational statistical mechanics
and thermodynamics, which we follow, prescribes, first, an analytic extension
of the spacetime to a Euclidean space with a Wick transformation of the time,
namely, $t=-i\tau$. Second, it states that the partition function of this
Euclidean space is given by

$\displaystyle Z(\beta,\phi,\bm{\gamma})=\int D[\bm{g}]D[\bm{A}]{\rm
e}^{-I[\beta,\phi,\bm{\gamma};\bm{g},\bm{A}]}\,,$ (1)

where $I[\beta,\phi,\bm{\gamma};\bm{g},\bm{A}]$ is the Euclidean action of the
system, $D[\bm{g}]$ and $D[\bm{A}]$ are the respective measures of the
integral for the Euclidean metric and the Maxwell field, $\beta$ is the
inverse temperature at $\mathcal{B}$ and $\phi$ is the electrostatic potential
at $\mathcal{B}$, both of which will be defined below.

When performing the integral, there are several considerations one must take
into account, as the notation in Eq. (1) is too abstract. First, the path
integral has the requirement that the Euclidean metric is periodic in time.
This is motivated by the usual construction of the partition function of large
quantum systems. The path integral in $\bm{g}$ is the sum of all the paths,
i.e., of all the possible values of $\bm{g}$, starting at a hypersurface
$\Sigma_{\tau_{0}}$ and then returning to $\Sigma_{\tau_{0}}$, where for
simplicity we adopt $\tau_{0}=0$. Note that the path integral is also summing
all the possible induced metrics in $\Sigma_{t_{0}}$. Second, the path
integral needs to be performed taking into consideration fixed data at the
boundary $\mathcal{B}$. The fixed data we are considering is the inverse
temperature $\beta$ given by

$\displaystyle\beta=\int_{0}^{2\pi}(\gamma_{\tau\tau})^{1/2}d\tau\,,$ (2)

which is also the proper Euclidean time length of $\mathcal{B}$, by
construction of the partition function, with $\gamma_{\tau\tau}$ being the
time-time component of the induced metric $\bm{\gamma}$. In addition, the
components of the vector field $A^{a}$ at $\mathcal{B}$ need to be fixed. More
specifically, we define the electrostatic potential at $\mathcal{B}$ as

$\displaystyle\beta\phi=2\pi iA_{\tau}\bigr{|}_{\mathcal{B}}.$ (3)

In the case the integral is well-defined and can be performed, the partition
function $Z$ of Eq. (1) will just depend on the inverse temperature $\beta$,
the electrostatic potential $\phi$ and other components of the induced metric
$\bm{\gamma}$.

We can relate the partition function of the grand canonical ensemble directly
to the thermodynamic grand potential and therefore obtain the thermodynamics
of the system. Note also that one can instead obtain the thermodynamic
quantities via the usual derivatives of $\ln Z$. The partition function can be
written as $Z(\beta,\phi,\bm{\gamma})_{\rm GC}={\rm e}^{-\beta
W[\beta,\phi,\bm{\gamma}]}$, where $W$ is the grand potential.

###  II.2 The Euclidean action

The Euclidean action of the system considered here is the Euclidean Hilbert-
Einstein-Maxwell action given by

$\displaystyle I=$
$\displaystyle-\int_{\mathcal{M}}\left(\frac{R}{16\pi}-\frac{F_{ab}F^{ab}}{4}\right)\sqrt{g}d^{d}x$
$\displaystyle-\frac{1}{8\pi}\int_{\mathcal{B}}(K-K_{0})\sqrt{\gamma}d^{d-1}x\,,$
(4)

where $R$ is the Ricci tensor depending on the metric $g_{ab}$ and its first
and second derivatives, $g$ is the determinant of $g_{ab}$,
$F_{ab}=\nabla_{a}A_{b}-\nabla_{b}A_{a}$ is the strength field tensor for the
Maxwell field $A_{a}$, $\nabla_{a}$ is the covariant derivative compatible
with $g_{ab}$, $K$ is the trace of the extrinsic curvature of $\mathcal{B}$
and $K_{0}$ is the trace of the extrinsic curvature of $\mathcal{B}$ embedded
in flat space. We use the convention that given an outward unit normal vector
$n^{a}$ to the hypersurface $\mathcal{B}$, then $K=\nabla_{a}n^{a}$.

###  II.3 Topology and boundary conditions

We are interested in evaluating the path integral with the boundary
$\mathcal{B}$ described by the history of a static spherical surface. It is
convenient to assume that the dominant terms in the path integral will
correspond to sets of metrics that are spherically symmetric. For coordinates
$(\tau,y,\theta^{A})$, where $\theta^{A}$ are the $d-2$ spherical coordinates
of the space, we assume a line element of the form

$\displaystyle
ds^{2}=b^{2}(y)d\tau^{2}+\alpha^{2}(y)dy^{2}+r^{2}(y)d\Omega^{2}\,,$ (5)

where $b(y)$, $\alpha(y)$, and $r(y)$, are the metric functions, functions of
$y$ alone, and $d\Omega$ is the volume element of a $(d-2)$-sphere. The volume
element of the space is $\sqrt{g}d^{d}x=b\alpha r^{d-2}d\tau dyd\Omega$.

We impose boundary conditions to the metric. At $y=0$, we require

$\displaystyle b(0)=0\,,$ (6)
$\displaystyle\evaluated{(b^{\prime}\alpha^{-1})}_{y=0}=1\,,$ (7)

where $b^{\prime}=\frac{db}{dy}$. The first condition comes from $y=0$ being a
degenerate hypersurface, since it corresponds to the black hole horizon. The
degenerate hypersurface will have a geometry $\mathbb{S}_{d-2}$, i.e., it is
the geometry of a $d-2$-sphere. Notice that hypersurfaces of constant $y$ have
a geometry $\mathbb{S}_{1}\times\mathbb{S}_{d-2}$, in which the length of
$\mathbb{S}_{1}$ smoothly goes to zero as $y$ goes to zero. The second
condition is required so that the geometry is regular, i.e., there is no
conical singularity at $y=0$. Defining $r^{\prime}=\frac{dr}{dy}$, we also
require that

$\displaystyle\evaluated{\left(\frac{r^{\prime}}{\alpha}\right)}_{y=0}=0\,,$
(8)

so that the hypersurface at $y=0$ inherits the property that the normal to the
black hole horizon $\evaluated{n_{a}=(0,r^{\prime},0,0)}_{y=0}$ is a null
vector. In even dimensions, the condition given in Eq. (8) can be motivated by
requiring that $\mathcal{M}$ has an Euler number $\chi=2$, but in odd
dimensions, there is no equivalent motivation, and since there is no effective
difference between even and odd dimensions in this context, it is better to
generically stick to the inheritance of the normal to the black hole horizon
property. Finally, we define that $r(0)=r_{+}$ is the radius of the black hole
horizon. The parameter $r_{+}$ is not fixed in the path integral.

The boundary $\mathcal{B}$ is assumed to be located at $y=1$ with induced
metric

$\displaystyle ds_{\mathcal{B}}^{2}=b(1)^{2}d\tau^{2}+R^{2}d\Omega^{2}\,,$ (9)

and its volume element is $\sqrt{\gamma}d^{d-1}x=b(1)R^{d-2}d\tau d\Omega$,
where we have defined $R\equiv r(1)$. The unit normal vector to the boundary
$\mathcal{B}$ is $r_{a}=(0,\alpha,0,0)$. The $\tau={\rm constant}$ surfaces
have area $A$ given by

$\displaystyle A=\Omega R^{d-2}\,,$ (10)

where $\Omega$ is the area of the unit sphere in $d-2$ dimensions
$\Omega=\frac{2\pi^{\frac{d-1}{2}}}{\Gamma\left(\frac{d-1}{2}\right)}$. For
$d=4$, the area is $\Omega=4\pi$, for $d=5$, $\Omega=2\pi^{2}$, and so on for
other higher dimensions.

The condition of fixed temperature, or fixed inverse temperature, at the
boundary $\mathcal{B}$ is given by the boundary condition

$\displaystyle\beta=2\pi b(1)\,,$ (11)

where $\beta$ is the inverse temperature, i.e., $\beta=\frac{1}{T}$, with $T$
being the temperature at the boundary. For the Maxwell field $A_{a}$,
spherical symmetry requires that the only non-zero component of the strength
field tensor is $F_{\tau y}$. One can choose a gauge in which only the
component $A_{\tau}$ of the Maxwell field is non-zero. It must be of the form
$A_{\tau}=A_{\tau}(y)$. We require that the Maxwell field is bounded, and so
we impose that

$\displaystyle A_{\tau}(0)=0\,.$ (12)

At the boundary $\mathcal{B}$, the Maxwell field should obey the boundary
condition motivated above

$\displaystyle\beta\phi=2\pi iA_{\tau}(1)\,,$ (13)

see Eq. (3).

###  II.4 Action of the spherically symmetric space

The action given in Eq. (4) of the space with the given boundary conditions
can now be computed.

The first integrand in the action corresponding to the integral over
$\mathcal{M}$ is the Ricci scalar $R$. For the line element given in Eq. (5),
it can be written as

$\displaystyle-\sqrt{g}\frac{R}{16\pi}=\frac{1}{8\pi}\left(\frac{r^{d-2}b^{\prime}}{\alpha}\right)^{\prime}+\frac{\alpha
br^{d-2}}{8\pi}{G^{\tau}}_{\tau}\,,$ (14)

where ${G^{\tau}}_{\tau}$ is the time-time component of the Einstein tensor
${G}_{ab}$, given by

$\displaystyle{G^{\tau}}_{\tau}=\frac{d-2}{2r^{\prime}r^{d-2}}\left(r^{d-3}\left[\left(\frac{r^{\prime}}{\alpha}\right)^{2}-1\right]\right)^{\prime}\,,$
(15)

and a prime means derivative with respect to $y$. The second integrand is
given by

$\displaystyle\sqrt{g}\frac{F_{ab}F^{ab}}{4}=\frac{1}{2}\frac{r^{d-2}}{\alpha
b}(A^{\prime}_{\tau})^{2}\,,$ (16)

where the expression $F_{y\tau}=A^{\prime}_{\tau}$ was used. The third
integrand is related to the extrinsic curvature of a hypersurface with
constant $y$. The extrinsic curvature of such a hypersurface is
$\bm{K}=\frac{bb^{\prime}}{\alpha}d\tau^{2}+\frac{rr^{\prime}}{\alpha}d\Omega^{2}$,
while the extrinsic curvature of a hypersurface with constant $y$ embedded in
flat space is just $\bm{K}_{0}=rd\Omega^{2}$, since in flat space
$\frac{r^{\prime}}{\alpha_{0}}=1$ and $b_{0}$ is constant. Therefore, the
integrand of the integral over the boundary $\mathcal{B}$ is

$\displaystyle-\frac{\sqrt{\gamma}}{8\pi}(K-K_{0})=$
$\displaystyle\evaluated{\frac{1}{8\pi}\left[(d-2)br^{d-3}\left(1-\frac{r^{\prime}}{\alpha}\right)-\frac{r^{d-2}b^{\prime}}{\alpha}\right]}_{y=1}\,.$
(17)

Having explicitly showed the integrands of the action given in Eq. (4), we can
perform their integration. Let us present some simplifications in the
integration process. The integral of the first term in Eq. (14) becomes two
terms which are
$\evaluated{\frac{r^{d-2}b^{\prime}}{8\pi\alpha}}_{y=1}-\evaluated{\frac{r^{d-2}b^{\prime}}{8\pi\alpha}}_{y=0}$,
i.e., a boundary term at $y=1$ and another at $y=0$. Moreover, the boundary
term at $y=1$ cancels with the term
$-\evaluated{\frac{r^{d-2}b^{\prime}}{8\pi\alpha}}_{y=1}$ in Eq. (17). To
evaluate the term $\evaluated{\frac{r^{d-2}b^{\prime}}{8\pi\alpha}}_{y=0}$ we
use the boundary condition Eq. (7), which is the condition that requires the
absence of conical singularities, to rewrite the boundary term at $y=0$ as
$\evaluated{\frac{r^{d-2}b^{\prime}}{\alpha}}_{y=0}=r_{+}^{d-2}$. Moreover,
the term
$\evaluated{(d-2)br^{d-3}\left(1-\frac{r^{\prime}}{\alpha}\right)}_{y=1}$ in
Eq. (17) can be further simplified. Integrating it over the Euclidean time
coordinate which has period $2\pi$ and using the boundary condition in Eq.
(11), i.e., $\beta=2\pi b(1)$, one obtains $(d-2)\beta
R^{d-3}\left(1-\evaluated{\frac{r^{\prime}}{\alpha}}_{y=1}\right)$.

Performing then the final integrations, one finds the action

$\displaystyle
I[\beta,\phi,R;b,\alpha,r,A_{\tau}]=\frac{(d-2)\Omega}{8\pi}\beta
R^{d-3}\left(1-\evaluated{\frac{r^{\prime}}{\alpha}}_{y=1}\right)$
$\displaystyle-\frac{1}{4}\Omega r_{+}^{d-2}+\int_{\mathcal{M}}\frac{\alpha
br^{d-2}}{8\pi}{G^{\tau}}_{\tau}d^{d}x+\int_{\mathcal{M}}\frac{r^{d-2}}{2\alpha
b}(A^{\prime}_{\tau})^{2}d^{d}x\,.$ (18)

Formally, one would then proceed with the calculation of the path integral in
$b$, $\alpha$, $r$ and $A_{\tau}$.

##  III Zero loop approximation

###  III.1 The reduced action

We perform the zero loop approximation of the path integral with the action in
Eq. (18), since we are interested in the semiclassical computation of the
partition function. The zero loop approximation consists on considering only
the contribution of the classical path to the path integral, neglecting the
other paths. The classical path obeys in this case the Einstein-Maxwell
equations with the prescribed boundary conditions. Note that there may be more
than one classical path, as we will see. Here, we follow the procedure given
in Braden:1990 . First, one imposes the constraint equations of the Einstein-
Maxwell equations to the possible paths. Then, one finds the zero-order action
and the semiclassical partition function.

The constraints of the metric are the momentum constraint and the Hamiltonian
constraint that come out from the Einstein equation $G_{ab}=8\pi T_{ab}$,
where $T_{ab}$ is the electromagnetic field energy-momentum tensor. The
momentum constraint is satisfied since the extrinsic curvature of a $\tau={\rm
const}$ hypersurface vanishes. The Hamiltonian constraint is given by
${G^{\tau}}_{\tau}=8\pi{T^{\tau}}_{\tau}$, where
$T_{ab}=F_{ac}F_{bd}g^{cd}-\frac{1}{4}g_{ab}F_{cd}F^{cd}$. So, the Hamiltonian
constraint is

$\displaystyle{G^{\tau}}_{\tau}=\frac{4\pi}{r^{2(d-2)}}\left(\frac{r^{d-2}}{\alpha
b}F_{y\tau}\right)^{2}\,.$ (19)

The Gauss constraint for the Maxwell field is given by the equation

$\displaystyle\nabla_{y}{{{F^{\tau y}}}}=0\,.$ (20)

One can integrate the Gauss constraint, Eq. (20), to find
$\frac{r^{d-2}}{\alpha b}F_{y\tau}=-i\frac{q}{\Omega}$, where $q$ is a
constant of integration chosen to be the Lorentzian electric charge of the
system. Then, using Eq. (15) for ${G^{\tau}}_{\tau}$ in Eq. (19), the
Hamiltonian constraint is
$\frac{(d-2)}{2r^{\prime}r^{d-2}}\left(r^{d-3}\left(\frac{r^{\prime
2}}{\alpha^{2}}-1\right)\right)^{\prime}=-\frac{4\pi}{\Omega^{2}r^{2d-4}}q^{2}$.
The Hamiltonian constraint can be integrated to yield

$\displaystyle\left(\frac{r^{\prime}}{\alpha}\right)^{2}=1-\frac{2\mu
m}{r^{d-3}}+\frac{\lambda q^{2}}{r^{2d-6}}\,,$ (21)

where $\mu m$ is a constant of integration and $\lambda$ is a convenient
parameter. The constant $\mu m$ can be written with the help of the boundary
condition in Eq. (8) as

$\displaystyle 2\mu m=r_{+}^{d-3}+\frac{\lambda q^{2}}{r_{+}^{d-3}}\,.$ (22)

When $m$ is understood as a mass then

$\displaystyle\mu=\frac{8\pi}{(d-2)\Omega}\,,$ (23)

such that in $d=4$ one has $\mu=1$, and the mass term is $2m$. The parameter
$\lambda$ is given by

$\displaystyle\lambda=\frac{8\pi}{(d-2)(d-3)\Omega^{2}}\,,$ (24)

such that in $d=4$, $\lambda=\frac{1}{4\pi}$. Since
$F_{y\tau}=A^{\prime}_{\tau}$, the integral of the Gauss constraint, Eq. (20),
is

$\displaystyle\frac{r^{d-2}}{\alpha b}A^{\prime}_{\tau}=-i\frac{q}{\Omega}\,.$
(25)

The action given in Eq. (18) can now be simplified using Eqs. (21) and (25) in
the following way. For the first term in Eq. (18), we use Eq. (21) to obtain

$\displaystyle\left(1-\evaluated{\frac{r^{\prime}}{\alpha}}_{y=1}\right)=1-\sqrt{f[R;r_{+},q]}\,,$
(26)

where $f[R;r_{+},q]$ is defined as

$\displaystyle
f[R;r_{+},q]=\left(1-\frac{r_{+}^{d-3}}{R^{d-3}}\right)\left(1-\frac{\lambda
q^{2}}{r_{+}^{d-3}R^{d-3}}\right)\,,$ (27)

and where use of Eq. (22) has been made. The term
$\int_{\mathcal{M}}\frac{\alpha br^{d-2}}{8\pi}{G^{\tau}}_{\tau}d^{d}x$ in Eq.
(18) can also be simplified using Eq. (19), $F_{y\tau}=A^{\prime}_{\tau}$, and
Eq. (25), yielding

$\displaystyle\int_{\mathcal{M}}\frac{\alpha
br^{d-2}}{8\pi}{G^{\tau}}_{\tau}d^{d}x$ $\displaystyle=\int d\tau
drd\Omega\left(\frac{r^{d-2}}{2\alpha
b}A^{\prime}_{\tau}\right)A^{\prime}_{\tau}$
$\displaystyle=-\frac{1}{2}q\beta\phi\,.$ (28)

The term depending explicitly on $A^{\prime}_{\tau}$ in Eq. (18), namely,
$\int_{\mathcal{M}}\frac{r^{d-2}}{2\alpha b}(A^{\prime}_{\tau})^{2}d^{d}x$,
can also be simplified. Using Eqs. (12), (13), and (25), one finds

$\displaystyle\int_{M}\left(\frac{r^{d-2}}{2\alpha
b}A^{\prime}_{\tau}\right)A^{\prime}_{\tau}d^{d}x$ $\displaystyle=\int d\tau
d\Omega\left(-i\frac{q}{2\Omega}\right)\evaluated{A_{\tau}}_{y=1}$
$\displaystyle=-\frac{1}{2}q\beta\phi\,.$ (29)

Then, putting Eqs. (26)-(29) into the action of Eq. (18), we obtain the
reduced action $I_{*}$ as

$\displaystyle I_{*}[\beta,\phi,R;r_{+},q]=$ $\displaystyle\frac{(d-2)\Omega
R^{d-3}\beta}{8\pi}\left(1-\sqrt{f[R;r_{+},q]}\right)$
$\displaystyle-q\beta\phi-\frac{\Omega r_{+}^{d-2}}{4}\,,$ (30)

Note that the parameters $r_{+}$ and $q$ are not fixed in the path integral.
In fact, with the constraints applied and the spherical symmetry of the
system, the remaining paths correspond to spaces with $\tau={\rm const}$
slices parameterized by any possible value of $r_{+}$ and $q$. The partition
function with the constraints is then given by

$\displaystyle Z[\beta,\phi,R]=\int D[r_{+}]D[q]{\rm
e}^{-I_{*}[\beta,\phi,R;r_{+},q]}\,.$ (31)

To fully apply the zero loop approximation, we must impose the rest of the
Einstein-Maxwell equations. This turns out to be equivalent to finding the
stationary points of the reduced action in $r_{+}$ and $q$. One then must
analyze if the stationary points minimize the action, since only there the
zero loop approximation is valid. The motivation for applying first the
constraint equations instead of applying the full equations is that the
reduced action is useful to understand the validity of the zero loop
approximation and therefore the stability of the solution given by the
stationary point.

###  III.2 Stationary points of the reduced action

####  III.2.1 Stationary points of the reduced action properly said

The solutions for an electrically charged black hole in a cavity within a
reservoir are given by finding the stationary points of the reduced action
given in Eq. (30), specifically,

$\displaystyle\frac{\partial I_{*}}{\partial r_{+}}=0\,,$ (32)
$\displaystyle\frac{\partial I_{*}}{\partial q}=0\,.$ (33)

Using Eq. (30) together with Eqs. (32) and(33), one finds that the stationary
points of $I_{*}[\beta,\phi,R;r_{+},q]$ occur when $\beta$ and $\phi$ assume
the following expressions

$\displaystyle\beta=\frac{4\pi}{(d-3)}\frac{r_{+}^{2d-5}}{r_{+}^{2d-6}-\lambda
q^{2}}\sqrt{f[R,r_{+},q]}\,,$ (34)
$\displaystyle\phi=\frac{q}{(d-3)\Omega\sqrt{f[R,r_{+},q]}}\left(\frac{1}{r_{+}^{d-3}}-\frac{1}{R^{d-3}}\right)\,,$
(35)

respectively. Since in the canonical ensemble $\beta$ and $\phi$ are fixed,
the solutions for the system of equations are $r_{+}=r_{+}(\beta,\phi,R)$ and
$q=q(\beta,\phi,R)$. The reduced action evaluated at a stationary point in
$r_{+}$ and $q$ is then formally

$\displaystyle
I_{0}[\beta,\phi,R]=I_{*}[\beta,\phi,R;r_{+}[\beta,\phi,R],q[\beta,\phi,R]]\,.$
(36)

From Eq. (30) one can thus write the reduced action $I_{0}[\beta,\phi,R]$ of
Eq. (36) as

$\displaystyle I_{0}[\beta,\phi,R]=$ $\displaystyle\frac{(d-2)\Omega
R^{d-3}\beta}{8\pi}\left(1-\sqrt{f[R;r_{+}[\beta,\phi,R],q[\beta,\phi,R]]}\right)$
$\displaystyle-q[\beta,\phi,R]\beta\phi-\frac{\Omega
r_{+}^{d-2}[\beta,\phi,R]}{4}\,,$ (37)

where $f[R;r_{+}[\beta,\phi,R],q[\beta,\phi,R]]$ can be taken from Eq. (27)
and the solutions of Eqs. (34) and (35). The partition function of the system
given in Eq. (31) then reduces to

$\displaystyle Z[\beta,\phi,R]={\rm e}^{-I_{0}[\beta,\phi,R]}\,,$ (38)

where $I_{0}[\beta,\phi,R]$ is taken from Eq. (37)

Now, Eqs. (34) and (35) for the stationary points can be put in a manageable
form. For that we first define the following quantities,

$\displaystyle\gamma=\frac{16\pi^{2}R^{2}}{(d-3)^{2}}\frac{\Phi^{2}}{\beta^{2}(1-\Phi^{2})^{2}}\,,$
(39) $\displaystyle\Phi=(d-3)\Omega\sqrt{\lambda}\phi\,,$ (40) $\displaystyle
x=\frac{r_{+}}{R}\,,$ (41) $\displaystyle y=\frac{\lambda q^{2}}{R^{2d-6}}\,.$
(42)

So, with these definitions, $\gamma$ substitutes the reservoir temperature
$T=\frac{1}{\beta}$, $\Phi$ represents the electric potential $\phi$, $x$ is
the horizon radius $r_{+}$ in units of the reservoir radius, and $y$ is a
representation for the electric charge $q$. Now, Eq. (35), written in these
variables, can be inverted to give
$y=\frac{x^{2d-6}\Phi^{2}}{1-(1-\Phi^{2})x^{d-3}}$, and this expression can be
used in Eq. (34), written in the new variables, to obtain

$\displaystyle(1-\Phi^{2})x^{d-1}-x^{2}+\frac{\Phi^{2}}{\gamma}=0\,.$ (43)

Equation (43) gives the values of $x=\frac{r_{+}}{R}$ at the stationary points
of the reduced action. Then, by using Eq. (43) in the expression
$y=\frac{x^{2d-6}\Phi^{2}}{1-(1-\Phi^{2})x^{d-3}}$, we obtain a simpler
relation between $y$ and $x$, namely,

$\displaystyle y=\gamma x^{2(d-2)}\,.$ (44)

Equation (44) gives the values of $y=\frac{\lambda q^{2}}{R^{2d-6}}$ at the
stationary points of the reduced action.

####  III.2.2 Analysis of the stationary points

The solutions for the Eq. (43) can be obtained analytically for specific
choices of $d$. Moreover, when $d$ is odd, one is able to reduce by half the
order of the equation. But, in general, for generic dimension $d$, it is not
possible to obtain an analytic expression.

Notwithstanding, one is able to study the behavior of Eq. (43) in terms of the
parameters $\gamma$ representing the fixed ensemble temperature, $\Phi$
representing the fixed ensemble electric potential, and the dimension $d$. One
imposes that the solutions must be physical, i.e., the black hole must lie
inside the cavity and it must be subextremal. The condition to lie inside the
cavity is

$\displaystyle 0\leq x<1\,,$ (45)

and the condition to be subextremal is $0\leq\frac{y}{x^{2(d-3)}}<1$. From Eq.
(44), this latter equation can be put as

$\displaystyle\gamma x^{2}<1\,.$ (46)

Replacing Eq. (43) in Eq. (46), one obtains that the condition can only be
obeyed if

$\displaystyle 0\leq\Phi^{2}<1\,.$ (47)

Now, from Eq. (43) it is useful to define the function

$\displaystyle h(x)=(1-\Phi^{2})x^{d-1}-x^{2}+\frac{\Phi^{2}}{\gamma}\,.$ (48)

The values of the function at the boundary of the domain are
$h(0)=\frac{\Phi^{2}}{\gamma}>0$ and $h(1)=h(0)(1-\gamma)$. Note that $\gamma$
can still be higher than 1, even though the condition given in Eq. (46) must
be obeyed. Indeed, $\gamma$ is proportional to the temperature squared and so
$\gamma$ can assume high values for high temperatures and fixed $\phi$ or
$\Phi$. Thus, we separate the analysis into $\gamma<1$, $\gamma=1$, and
$\gamma>1$.

$\gamma<1$:

For $\gamma<1$, one has $h(1)>0$ and so we must compute the zeros of the
derivative of $h(x)$, $h^{\prime}(x)$, and the sign of the second derivative
to deduce how many zeros $h(x)$ contains. We have that
$h^{\prime}(x)=x(d-1)(1-\Phi^{2})\left(x^{d-3}-\frac{2}{(d-1)(1-\Phi^{2})}\right)$
and $h^{\prime\prime}(x)=(d-1)(d-2)(1-\Phi^{2})x^{d-3}-2$. The derivative of
$h(x)$ vanishes, i.e., $h^{\prime}(x_{\rm bif})=0$, and the second derivative
is positive, i.e., $h^{\prime\prime}(x_{\rm bif})>0$, at a bifurcation point
$x_{\rm bif}$ given by

$\displaystyle x_{\rm
bif}=\left(\frac{2}{(d-1)(1-\Phi^{2})}\right)^{\frac{1}{d-3}}\,.$ (49)

The point $x_{\rm bif}$ gives the only minimum of $h(x)$, with value $h(x_{\rm
bif})$, so that $h(x)$ bifurcates to higher values for $x$ lower or greater
than $x_{\rm bif}$. In the case of $\gamma<1$, if the location of the minimum
lies in the interval $x_{\rm bif}>1$, then there are no zeros of $h(x)$ since
$h(x)>0$ in the interval $0\leq x<1$. If the minimum of $h(x)$ lies in the
interval $0<x_{\rm bif}<1$, which implies $\Phi^{2}<\frac{d-3}{d-1}$, then
$h(x)$ may have zeros, but this is not a sufficient condition. One also must
have the condition $h(x_{\rm bif})<0$, which implies $\gamma_{\rm
bif}(\Phi,d)\leq\gamma$, with

$\displaystyle\gamma_{\rm
bif}(\Phi,d)\equiv\frac{(d-1)^{\frac{d-1}{d-3}}}{4^{\frac{1}{d-3}}(d-3)}\Phi^{2}(1-\Phi^{2})^{\frac{2}{d-3}}\,.$
(50)

Therefore, in brief we have the following results. For

$\displaystyle\gamma<\gamma_{\rm bif}\,,$ (51)

there are no solutions. For

$\displaystyle\gamma_{\rm bif}\leq\gamma<1\,,$ (52)

there are two solutions. We denominate these two solutions by $x_{1}$ and
$x_{2}$, with $x_{1}\leq x_{2}$. Moreover,

$\displaystyle x_{1}\leq x_{\rm bif}\leq x_{2}\,.$ (53)

When the equality is saturated in Eq. (52), i.e., $\gamma=\gamma_{\rm bif}$,
the two solutions merge into one with $x_{1}=x_{\rm bif}=x_{2}$. Conversely,
one can envisage the two solutions $x_{1}$ and $x_{2}$ as bifurcating from
$x_{\rm bif}$. Both solutions obey the conditions set in Eqs. (45)-(47), and
also obey

$\displaystyle 0\leq\Phi^{2}<\frac{d-3}{d-1}\,,$ (54)

which is a stronger condition than Eq. (47).

$\gamma=1$:

For $\gamma=1$, one of the zeros of $h(x)$ is $x=1$. We note however that this
point is a critical point in the sense that it does not have the derivatives
in Eqs. (32)-(33) defined. If $\Phi^{2}\leq\frac{d-3}{d-1}$, the other zero is
smaller than $x=1$ or, in the case of equality, there is no other zero.
Otherwise, the other zero is larger than $x=1$ and is nonphysical.

$\gamma>1$:

For $\gamma>1$, the function $h(x)$ will always have one zero between $0\leq
x<1$, while the other solution will be at $x>1$, for $0<\Phi^{2}<1$. The
former zero is physical but we will see that it can be disregarded because of
stability, while the latter is unphysical since it lies outside the cavity.

Figure 1:  Top plot: Stationary points of the action, $x_{1}$ (in blue) and
$x_{2}$ (in red), in function of $RT$, for $\phi=0.02$ and for four values of
$d$: $d=4$ in dotted lines, $d=5$ in dashed lines, $d=7$ in solid lines, and
$d=10$ in dot dashed lines. Bottom plot: Stationary points of the action,
$x_{1}$ (in blue) and $x_{2}$ (in red), in function of $\phi$, for $RT=0.3$,
and the maximum value of $\phi$ (in orange) corresponding to $\Phi=1$, for
four values of $d$: $d=4$ in dotted lines, $d=5$ in dashed lines, $d=7$ in
solid lines, and $d=10$ in dot dashed lines.

Note from the definition of $\gamma$ in Eq. (39) that
$\gamma\propto\frac{R^{2}}{\beta^{2}}$, therefore when considering the
solutions in function of the temperature, i.e., in function of
$\frac{R}{\beta}$ or of $RT$, with $\Phi^{2}<\frac{d-3}{d-1}$, the solution
$x_{2}$ will have the range $0\leq x_{2}<1$ for a finite range of
$T=\frac{1}{\beta}$. More specifically, for
$RT=\frac{d-3}{4\pi\absolutevalue{\Phi}}(1-\Phi^{2})$, i.e., $\gamma=1$, one
has $x_{2}=1$ and so for higher values of $RT$, one has $x_{2}>1$. This
behavior is not present in the electrically uncharged case, see Andre:2021 .
The plot of the two solutions, $x_{1}$ and $x_{2}$, as functions of $RT$ for
constant $\phi=0.02$ and for four values of $d$ is shown in the top part of
Fig. 1. The plot of the two solutions, $x_{1}$ and $x_{2}$, as functions of
$\phi$ for constant $RT=0.3$ and four values of $d$ is shown in the bottom
part of Fig. 1. In these plots, the quantity $\phi$ was chosen instead of
$\Phi$ to show the full dependence of the solutions in the parameter $d$,
indeed $\phi$ is the quantity fixed at the cavity while $\Phi$ is proportional
to $\phi$ but the coefficient depends on $d$.

###  III.3 Perturbations around the zero loop approximation and stability
analysis

####  III.3.1 Perturbations around the zero loop approximation

We extend the calculation of the path integral by analyzing its expansion
around the classical path. The reduced action near the stationary points is

$\displaystyle
I_{*}[\beta,\phi,R;r_{+},q]=I_{0}[\beta,\phi,R]+\sum_{ij}{I_{*0}}_{ij}\delta
i\delta j\,,$ (55)

where $I_{0}[\beta,\phi,R]$ is defined generically in Eq. (36) and
specifically in Eq. (37), and ${I_{*0}}_{ij}$ stands for the second
derivatives of the reduced action
${I_{*}}_{ij}=\frac{\partial^{2}I_{*}}{\partial i\partial j}$ evaluated at an
extremum of the action, with $i$ and $j$ being either $r_{+}$ or $q$. Then,
from Eq. (31) we have for the path integral and the corresponding partition
function the following expression

$\displaystyle Z[\beta,\phi,R]={\rm e}^{-I_{0}[\beta,\phi,R]}\int D[\delta
q]D[\delta r_{+}]{\rm e}^{-\sum_{ij}{I_{*0}}_{ij}\delta i\delta j}\,.$ (56)

To have a proper path integral and a proper partition function, the stationary
point of the reduced action must be a minimum.

To explicitly obtain the latter condition, we must compute the second
derivatives of the reduced action which from Eq. (30) and Eqs. (34)-(35), or
Eqs. (43)-(44), are

$\displaystyle{I_{*0}}_{r_{+}r_{+}}=\frac{(d-2)\Omega
R^{d-3}\beta}{16\pi\sqrt{f}r_{+}^{2}}\mathcal{I}_{r_{+}r_{+}}\,,$ (57)
$\displaystyle{I_{*0}}_{r_{+}q}=\frac{(d-2)\Omega
R^{d-3}\beta}{16\pi\sqrt{f}r_{+}q}\mathcal{I}_{r_{+}q}\,,$ (58)
$\displaystyle{I_{*0}}_{qq}=\frac{(d-2)\Omega
R^{d-3}\beta}{16\pi\sqrt{f}q^{2}}\mathcal{I}_{qq}\,,$ (59)

with

$\displaystyle\mathcal{I}_{r_{+}r_{+}}=\frac{d-3}{fx^{2d-6}}\Big{[}\frac{d-3}{2}\left(x^{2d-6}-y\right)^{2}$
$\displaystyle-\left(x^{2d-6}-(2d-5)y\right)\left(1-x^{d-3}\right)\left(x^{d-3}-y\right)\Big{]}\,,$
(60)
$\displaystyle\mathcal{I}_{r_{+}q}=-\frac{(d-3)}{x^{d-3}}\frac{\left(2x^{d-3}-x^{2d-6}-y\right)}{x^{d-3}-y}y\,,$
(61) $\displaystyle\mathcal{I}_{qq}=2\frac{1-x^{d-3}}{x^{d-3}-y}y\,.$ (62)

The matrix ${I_{*0}}_{ij}$ is positive definite if the pivots of the matrix
after Gauss elimination are positive or, in this case, since the matrix has
rank 2, the first element on the diagonal and the determinant need to be
positive, i.e.,

$\displaystyle\mathcal{I}_{r_{+}r_{+}}>0\,,$ (63)
$\displaystyle\mathcal{I}_{r_{+}r_{+}}\mathcal{I}_{qq}-\mathcal{I}_{r_{+}q}^{2}>0\,.$
(64)

Since from Eq. (62) $\mathcal{I}_{qq}$ is always positive, we have that the
last condition, Eq. (64), is sufficient. Using Eqs. (60)-(62) and (44), we
have that the condition in Eq. (64) reduces to

$\displaystyle-(d-3)\gamma x^{d-1}+(d-1)x^{d-3}-2>0\,.$ (65)

This is the condition for a stationary point, given by Eqs. (43) and (44), to
be a minimum of the action.

####  III.3.2 Stability analysis

Since the stability condition is applied to the stationary points of the
reduced action, one can use Eq. (43) to simplify the condition given in Eq.
(65) in the following way. One can rewrite Eq. (43) to get
$\gamma=\frac{\Phi^{2}}{x^{2}-(1-\Phi^{2})x^{d-1}}$ and substitute $\gamma$
into Eq. (65) obtaining a condition depending solely on $r_{+}$ and $\Phi$.
So, on using Eq. (43), one gets that Eq. (65) indeed simplifies to

$\displaystyle\frac{((d-1)(1-\Phi^{2})x^{d-3}-2)(1-x^{d-3})}{1-(1-\Phi^{2})x^{d-3}}>0\,\,\,.$
(66)

The physical range of solutions is $0\leq x^{d-3}<1$, and so the denominator
is always greater than zero. Therefore, there is thermodynamic stability if
the solution satisfies

$\displaystyle x>x_{\rm bif}\,,$ (67)

where $x_{\rm bif}=\left(\frac{2}{(d-1)(1-\Phi^{2})}\right)^{\frac{1}{d-3}}$,
see Eq. (49). Note that $x_{\rm bif}$ is the value of $x=\frac{r_{+}}{R}$ from
which the two solutions $x_{1}$ and $x_{2}$ bifurcate from, and so one always
has that $x_{1}\leq x_{\rm bif}\leq x_{2}$. Thus, the bifurcation radius is
equal to the marginal thermodynamic stability radius. In the electrically
uncharged case the bifurcation and marginal thermodynamic stability radius and
the photon sphere radius coincide, so it is worth to see if this stands in the
electrically charged case, see Appendix A. We now analyze the stability for
each case of $\gamma$.

$\gamma<1$:

For the case of $\gamma_{\rm bif}<\gamma<1$ and $\Phi^{2}<\frac{d-3}{d-1}$,
one has $x_{1}<x_{\rm bif}<x_{2}<1$, so $x_{1}$ is unstable and it corresponds
to a saddle point of the action, while $x_{2}$ is stable and corresponds to a
minimum of the action. For the case of $\frac{d-3}{d-1}\leq\Phi^{2}<1$, both
solutions $x_{1}$ and $x_{2}$ are not physical as they lie outside the cavity.
We now analyze the case $x_{1}=x_{\rm bif}=x_{2}$. One must note that $x_{\rm
bif}$ is the only solution of Eq. (43) for $\gamma=\gamma_{\rm bif}$ and for
which Eq. (66) is an equality rather than an inequality. Thus, one cannot
specify the critical point with only second derivatives of the action, perhaps
third derivatives will do. However, by inspection of the action $I(x,y)$ at
this point one finds that it is a saddle point.

$\gamma=1$:

For the case of $\gamma=1$ and $\Phi^{2}<\frac{d-3}{d-1}$, the solution
$x_{1}$ is unstable, while the solution $x_{2}$ reaches the boundary of the
cavity, $x_{2}=1$, and at this point the derivatives of the action are not
well-defined, so one cannot specify the stability. For the case of
$\Phi^{2}=\frac{d-3}{d-1}$ the two solutions $x_{1}$ and $x_{2}$ reach the
boundary and the derivatives of the action are not well-defined as well. For
the case of $\frac{d-3}{d-1}<\Phi^{2}<1$, the solution $x_{2}$ lies outside
the cavity, thus not physical, while $x_{1}$ is at the boundary of the cavity,
$x_{1}=1$, and one cannot specify its stability.

$\gamma>1$:

For the case of $\gamma>1$ and for $0<\Phi^{2}<1$, the solution $x_{1}$
resides inside the cavity and it is still unstable, while the solution $x_{2}$
is not physical as it is outside the cavity, i.e., $x_{2}>1$.

###  III.4 Most probable configurations

From Eq. (31), we see that the paths with less $I_{*}$, or from Eq. (38) the
paths with less $I_{0}$, are the ones that contribute more to the partition
function, and so yield the most probable states. Here we deal with stable
solutions and among those we want to find the one that gives the most probable
state.

In the electrically uncharged case done in York:1986  for $d=4$ and in
Andre:2020 ; Andre:2021  for generic $d$, the comparison between the stable
black hole solution and hot flat space was made. The stable black hole is a
stationary point of the reduced action, and the hot flat space solution is an
extra stationary point. The most probable state is the one with the lowest
value of the action. In the case of the uncharged black holes, the value of
the action $I_{0}$ depends on $\beta$, while in the case of hot flat space one
has $I_{\rm hot\,flat\,space}=0$. In Andre:2020 ; Andre:2021 , it was shown
for any dimension $d\geq 4$ that $I_{0}<I_{\rm hot\,flat\,space}$ if $\beta$
is such that $\frac{r_{+}}{R}>\frac{r_{\rm Buch}}{R}$, where $r_{\rm Buch}$ is
the Buchdahl radius. In addition, in Andre:2020 ; Andre:2021 , a comparison
between the stable black hole solution and quantum hot flat space was also
done.

In the electrically charged case, one can also make a comparison of the stable
black hole with the charged equivalent of the uncharged hot flat space, as we
will see. The electrically charged case is more rich than the uncharged one.
In the charged case, besides the stationary point related to the stable black
hole, there are two critical points that are possible stable solutions of the
ensemble. One critical point, which is a stationary point indeed, is $r_{+}=0$
and $q=0$, corresponding to a cavity without a black hole and without charge.
This seems unphysical for a fixed nonzero value of $\phi$, since it means that
there is a difference of electric potential, which in turn implies the
existence of an electric field and thus of an electric charge. For this
reason, $q=0$ seems unphysical. However, we have to recall that the path
integral approach in the semiclassical approximation deals intrinsically with
quantum systems, and when one writes $q=0$, one should mean $q$ of the order
of the Planck charge, and a particle, say, carrying such a charge should be
envisaged as having the dimensions of the order of a Planck length or a bit
higher. Thus, we have to seek a corresponding action for such a particle in a
reservoir of fixed $R$ and $\beta$. The other critical point is $r_{+}=R$ and
$\sqrt{\lambda}q=R^{d-3}$, so that
$r_{+}=(\sqrt{\lambda}q)^{\frac{1}{d-3}}=R$. This critical point corresponds
to an extremal black hole with the horizon localized at the radius of the
cavity, meaning that the volume of the Euclidean space is zero, which can
require a different procedure. However, again, this is a quantum system
treated semiclassically, and so one should think of a black hole almost at its
extremal state, failing to be extremal by a Planck charge and not touching the
reservoir at $R$ by a Planck length. Thus, in this state the approach is still
valid under our treatment, and we have to find the value of the action for a
large extreme black hole in a reservoir with fixed $R$ and $\beta$. So, the
question of whether the stable black hole is the ground state or there is
another ground state to which the black hole can make a transition is a
pertinent one.

Let us now deal with the first critical point $r_{+}=0$ and $q=0$, at which
the derivative of the action in order to $q$ is not well-defined. Nonetheless,
one can argue that this critical point can be considered as a local minimum of
the action in the physical domain, see Appendix B for the calculation. In an
attempt to describe an equivalent of hot flat space, we consider a hot sphere,
made of a perfect conductor material, with a certain radius $r_{\rm hs}$,
inside the reservoir at constant $\beta$ and $\phi$, and with its center
situated at the center of the reservoir. There is no gravitational
interaction, i.e., the constant of gravitation is put to zero. This is
equivalent to consider only the Maxwell term in Eq. (4). One must then
consider a fixed radius $r_{\rm hs}$ for the hot sphere conductor, in the
boundary conditions. From the Gauss constraint, the charge of the conducting
sphere can be related directly to the value of $\phi$. Indeed, one has
$\phi=\frac{q}{(d-3)\Omega}\left(\frac{1}{r_{\rm
hs}^{d-3}}-\frac{1}{R^{d-3}}\right)$, see also Eq. (35). Therefore, the action
for this cavity being $I=-\frac{1}{2}q\beta\phi$, turns, for the perfect
conducting hot sphere in flat space, into the expression

$\displaystyle I_{\rm
hot\,sphere}=-\frac{1}{2}\,\frac{(d-3)\Omega}{\frac{1}{r_{\rm
hs}^{d-3}}-\frac{1}{R^{d-3}}}\beta\phi^{2}\,.$ (68)

One can then compare the action of the conducting hot sphere with radius
$r_{\rm hs}$ given in Eq. (68) with the action of the stable configuration of
the charged black hole, which is Eq. (30) with the largest positive solution
of Eq. (43), i.e., the $r_{+2}$ solution. From Eq. (68), it is clear that if
$r_{\rm hs}$ is high, of the order of $R$, say, then $I_{\rm hot\,sphere}$ is
large and negative and so the hot flat sphere is the most probable solution
when compared to the stable black hole $r_{+2}$. On the other hand, if $r_{\rm
hs}$ is tiny, as we expect to be when dealing with a case analogous to hot
flat space, then $I_{\rm hot\,sphere}=0$, or approximately zero. In this
situation one can say that $I_{\rm hot\,sphere}$ is indeed $I_{\rm
hot\,flat\,space}$ which is a configuration with zero action. The stable black
hole does have positive action for low temperatures $T$, specifically, near
the minimum temperature where the stable black hole exists. Therefore, one
finds that the tiny charged sphere that emulates hot flat space is more
probable for a small interval of low temperatures when compared with the
stable black hole. Conversely, the black hole is more probable for a large
interval of temperatures, in fact, when the solution of the stable black hole
has

$\displaystyle\frac{r_{+2}^{d-3}}{R^{d-3}}\geq\mu m+\sqrt{\mu^{2}m^{2}-\lambda
q^{2}}\,.$ (69)

where $\mu=\frac{8\pi}{(d-2)\Omega}$, see Eq. (23), and also $\mu
mR^{3-d}=-\frac{4(d-2)^{2}}{(d-1)^{2}(d-3)^{2}}+\frac{2(d-2)((d-2)^{2}+1)}{(d-1)^{2}(d-3)^{2}}\sqrt{1+\frac{(d-1)^{2}(d-3)^{2}}{4(d-2)^{2}}\frac{\lambda
q^{2}}{R^{2d-6}}}$, see Appendix A for this equality. When Eq. (69) is obeyed
then the action for the black hole $r_{+2}$ is negative and the black hole is
more probable, when Eq. (69) is not obeyed the tiny charged sphere is more
probable. Notice that this radius $R$ does not have a connection to the
Buchdahl-Andreásson-Wright radius Wright:2015 , a radius that generalizes the
Buchdahl bound for $d$-dimensional self-gravitating electric charged spheres.
The horizon radius with zero action is equal or lower than the Buchdahl-
Andreásson-Wright radius in the case of $d=4$, with a difference up to $0.004$
in $\frac{\mu m}{R}$, and being equal in the uncharged case and the extreme
case $\sqrt{\lambda}q=R$. Thus, the equality in the uncharged situation of the
minimum most probable radius of a black hole in the canonical ensemble and the
Buchdahl radius does not hold when other fields are added. So, it is a very
restricted equality holding only in the pure gravitational situation.

Let us now deal with the second critical point $r_{+}=R$ and
$\sqrt{\lambda}q=R^{d-3}$, i.e., an extremal black hole with the horizon
localized at the radius of the cavity, bearing in mind that the precise
extremality and the precise location can fluctuate by Planck order quantities.
We note that this is a critical point in the sense that the gradient of the
action is not defined. Indeed, one can calculate the gradient of the reduced
action in Eq. (30) and make the limit to
$r_{+}=(\sqrt{\lambda}q)^{\frac{1}{d-3}}=R$ along the curve
$\frac{r_{+}}{R}=(1-\epsilon)^{\frac{1}{d-3}}$ and
$\frac{\sqrt{\lambda}q}{R^{d-3}}=\sqrt{(1-\eta\epsilon)}$, where $\eta$ is a
positive constant and $\epsilon$ parameterizes the curve. The constant $\eta$
is restricted to the physical domain of the action, with the condition
$\eta>2$. After substituting the variables by the parameterization of the
curve in the expression of the gradient and performing the limit
$\epsilon\rightarrow 0^{+}$, the gradient assumes an expression that depends
on the constant $\eta$. Since the limit is different for different values of
$\eta$, then the gradient cannot be defined in that point, but one can still
analyze the directional derivatives along the considered paths. The
directional derivatives along decreasing $\epsilon$, i.e., from lower $r_{+}$
and $q$ towards $r_{+}=(\sqrt{\lambda}q)^{\frac{1}{d-3}}=R$, may be either
positive, zero, or negative, and so the critical point does not resemble a
local minimum. In particular, there is a set of temperatures and electric
potential given by the condition $\gamma=1$, where the stable black hole
solution tends to this extremal black hole. Indeed, it can be seen that for
such values of temperature and electric potential, there is a value of $\eta$
in which the limit of the gradient vanishes, but the fact still remains that
the gradient is undefined here, see Appendix B for a detailed analysis of the
gradient at this critical point. Nevertheless, this critical point may be
smoothed up by taking in consideration higher loops in the path integral or a
different theory of gravity. The action for this critical point can be taken
from Eq. (30), i.e., $I_{\rm extreme\,black\,hole}=\frac{(d-2)\Omega
R^{d-3}\beta}{8\pi}\Bigl{(}1-\Bigr{.}\left.\sqrt{f(R,r_{+},q)}\right)-q\beta\phi-\frac{\Omega
r_{+}^{d-2}}{4}$, where $f(R,r_{+},q)$ is taken from Eq. (27) with $r_{+}$ and
$q$ having extremal values, so that $R=r_{+}$ and $f(R,r_{+},q)=0$. Then,

$\displaystyle I_{\rm extreme\,black\,hole}=$ $\displaystyle\frac{(d-2)\Omega
R^{d-3}\beta}{8\pi}$
$\displaystyle-\frac{R^{d-3}}{\sqrt{\lambda}}\beta\phi-\frac{\Omega
R^{d-2}}{4}\,.$ (70)

So $I_{\rm extreme\,black\,hole}$ has to be analyzed for each $R$, $\beta$ and
$\phi$, and compared with the action for the stable black hole $r_{+2}$. It
seems that the stable black hole is always a more probable configuration than
the extreme black hole with horizon at the cavity.

##  IV Thermodynamics of the $d$-dimensional Reissner-Nordström black hole
space in a cavity

###  IV.1 Connection between the grand canonical potential $W$ of
thermodynamics and the statistical mechanics grand canonical partition
function $Z$ found from the path integral action $I$

We can relate the partition function $Z$ of the grand canonical ensemble
directly to the thermodynamic grand potential $W$ and therefore obtain the
thermodynamics of the system. The relation is

$\displaystyle Z(\beta,\phi,\bm{\gamma})={\rm e}^{-\beta
W[\beta,\phi,\bm{\gamma}]}\,,$ (71)

or $\beta W=-\ln Z$.

In the semiclassical approximation, one has $Z={\rm e}^{-I_{0}}$ and so one
has $\beta W[\beta,\phi,R]=I_{0}[\beta,\phi,R]$. By taking in consideration
that $\beta=\frac{1}{T}$, one can write the relation between the thermodynamic
grand potential $W$ and the action $I_{0}$ as

$\displaystyle W[T,\phi,A(R)]=T\,I_{0}[T,\phi,R]\,.$ (72)

Therefore, from Eqs. (37) and (72), the grand potential $W$ can be written as

$\displaystyle W=$ $\displaystyle\frac{(d-2)\Omega
R^{d-3}}{8\pi}\Bigl{(}1-\sqrt{f\left(R,T,\phi\right)}\Bigr{)}$
$\displaystyle-T\frac{\Omega r_{+}^{d-2}(R,T,\phi)}{4}-q(R,T,\phi)\phi\,,$
(73)

where $f(R,T,\phi)$ can be taken from Eq. (27) and the solutions of Eqs. (34)
and (35).

The grand canonical potential $W$ can be written by definition as a Legendre
transformation of the mean energy $E$. Written in terms of $E$, the mean
electrical charge $Q$, the electric potential $\phi$, the entropy $S$, and the
temperature $T$, one has

$\displaystyle W=E-TS-Q\phi\,,$ (74)

where $E=E(S,Q,A)$. Moreover, the entropy, the mean charge, and the
thermodynamic pressure are obtained from the derivatives of the grand
potential, which then allows one to find the mean energy by Eq. (74).

The connection between the statistical path integral and thermodynamics can be
summarized by Eq. (72), in the zero loop approximation. However, it is
interesting to see the relationship between the choice of the path with
minimum action, in the path integral, and the thermodynamics of the system, in
the zero loop approximation. Indeed, it seems that if one identifies the
expression of the quantities $E$, $S$ and $Q$ in the reduced action, the
choice of the path with minimum action imposes that the temperature and the
electric potential are partial derivatives of the energy, as one would expect
from the first law of thermodynamics, see Appendix C.

###  IV.2 Thermodynamic quantities and relations

####  IV.2.1 Mean energy, entropy, mean charge, and thermodynamic pressure

The grand potential $W=W[T,\phi,R]$ of the cavity is given by Eq. (73). Since
$A=4\pi R^{2}$, see Eq. (10), one can trade $R$ for $A$ in $W$ to have the
dependence $W=W[T,\phi,A]$. One can then write the differential of this form
of the grand potential $W$ as

$\displaystyle dW=-SdT-pdA-Qd\phi\,,$ (75)

where from Eqs. (74) and (75) one has $S=-\left(\frac{\partial W}{\partial
T}\right)_{A,\phi}$, $p\equiv-\left(\frac{\partial E}{\partial
A}\right)_{S,Q}=-\left(\frac{\partial W}{\partial A}\right)_{T,\phi}$, and
$Q=-\left(\frac{\partial W}{\partial\phi}\right)_{A,T}$. Here, a quantity in a
subscript means that the partial derivative is performed with the
corresponding quantity being kept constant, e.g., $\left(\frac{\partial
W}{\partial T}\right)_{A,\phi}$ means partial derivative of $W$ in relation to
$T$ with $A$ and $\phi$ kept constant. In order to obtain the thermodynamic
quantities, we must evaluate the derivatives just given of the grand potential
$W$.

We start by calculating the entropy $S=-\left(\frac{\partial W}{\partial
T}\right)_{A,\phi}$. From Eq. (73) we see that
$W=W(T,\phi,A,r_{+}(T,\phi,R),q(T,\phi,R))$. So, using the chain rule one has
$S=-\left(\frac{\partial W}{\partial T}\right)_{A,\phi}=-\left(\frac{\partial
W}{\partial T}\right)_{r_{+},q,A,\phi}-\left(\frac{\partial W}{\partial
r_{+}}\right)_{q,T,A,\phi}\left(\frac{\partial r_{+}}{\partial
T}\right)-\left(\frac{\partial W}{\partial
q}\right)_{r_{+},T,A,\phi}\left(\frac{\partial q}{\partial T}\right)$. Now,
the black hole solutions given by $r_{+}(T,\phi,R)$ and $q(T,\phi,R)$ obey by
definition the conditions $\left(\frac{\partial W}{\partial
r_{+}}\right)_{q,T,A,\phi}\equiv 0$ and $\left(\frac{\partial W}{\partial
q}\right)_{r_{+},T,A,\phi}\equiv 0$, yielding thus simply
$S=-\left(\frac{\partial W}{\partial T}\right)_{A,\phi}=-\left(\frac{\partial
W}{\partial T}\right)_{r_{+},q,A,\phi}$. So, Eq. (73) yields directly

$\displaystyle S=\frac{A_{+}}{4}\,,$ (76)

with $A_{+}$ is the area of the horizon given by $A_{+}=\Omega r_{+}^{d-2}$.
Thus, Eq. (76) yields that the black hole entropy is indeed given by the
Bekenstein-Hawking entropy formula.

In the same manner, one can calculate the electric charge $Q$ to give the
expression $Q=-\left(\frac{\partial
W}{\partial\phi}\right)_{T,A}=-\left(\frac{\partial
W}{\partial\phi}\right)_{r_{+},q,T,A}$, yielding

$\displaystyle Q=q\,,$ (77)

so the thermodynamic value of the electric charge $Q$ is equal to the typical
electric charge $q$ of a Reissner-Nordström black hole.

The pressure is given by $p=-\left(\frac{\partial W}{\partial
A}\right)_{T,\phi}=-\frac{1}{(d-2)\Omega R^{d-3}}\left(\frac{\partial
W}{\partial R}\right)_{r_{+},q,T,\phi}$ and so it has the form

$\displaystyle p=\frac{d-3}{16\pi
R\sqrt{f}}\left(\left(1-\sqrt{f}\right)^{2}-\frac{\lambda
q^{2}}{R^{2d-6}}\right)\,,$ (78)

which is the gravitational tangential pressure at the reservoir at radius $R$.

Finally, one can calculate the energy by putting Eqs. (76)-(78) into Eq. (74)
and finding that

$\displaystyle E=\frac{(d-2)\Omega R^{d-3}}{8\pi}\left(1-\sqrt{f}\right)\,,$
(79)

which is the thermodynamic energy, a quasilocal energy, evaluated at radius
$R$.

One can verify from the previous equations that

$\displaystyle TdS=dE+pdA-\phi dQ\,,$ (80)

i.e., the first law of thermodynamics for the system holds. In Eq. (80),
$T=\frac{1}{\beta}$ can be taken from Eq. (34), $S$ is given by Eq. (76), $E$
is given by Eq. (79), $p$, is given by Eq. (78), $\phi$ is given by Eq. (35),
and $Q$ is given by Eq. (77).

It is worth pointing out that the expressions of the entropy, the mean charge,
and the energy can be taken naively from the comparison of Eq. (73) with Eq.
(74), but this is in fact true only because by definition of $I_{0}$, and thus
of $W=TI_{0}$, the conditions $\left(\frac{\partial W}{\partial
r_{+}}\right)_{q,T,A,\phi}\equiv 0$ and $\left(\frac{\partial W}{\partial
q}\right)_{r_{+},T,A,\phi}\equiv 0$, are identically satisfied. Thus, the
extrema of the reduced action $I_{*}$ can be interpreted as points that set
the first law of thermodynamics in Eq. (80), see also Appendix C.

####  IV.2.2 Euler equation, Gibbs -Duhem relation, and Smarr formula

With the thermodynamic variables $E$, $A$, and $Q$ determined, one is able to
obtain the Euler equation and the Gibbs-Duhem relation, i.e., the energy in
terms of the remaining thermodynamic variables and differential relation
between the thermodynamic variables, respectively.

The energy in Eq. (79) can be rewritten in terms of the entropy $S$, surface
area of the cavity $A$, and charge $Q$ as

$\displaystyle E=$
$\displaystyle\frac{(d-2)A^{\frac{d-3}{d-2}}\Omega^{\frac{1}{d-2}}}{8\pi}$
$\displaystyle\left(1-\sqrt{\left(1-\left(\frac{4S}{A}\right)^{\frac{d-3}{d-2}}\right)\left(1-\frac{\lambda
Q^{2}\Omega^{2\frac{d-3}{d-2}}}{(4SA)^{\frac{d-3}{d-2}}}\right)}\right)\,.$
(81)

One can then use the Euler’s homogeneous function theorem considering that
under a rescaling $\nu$ of its arguments, the energy as a function has the
property that $E\left(\nu S,\nu A,\nu
Q^{\frac{d-2}{d-3}}\right)=\nu^{\frac{d-3}{d-2}}E\left(S,A,Q^{\frac{d-2}{d-3}}\right)$.
We thus have an integrated version of the first law of thermodynamics given by

$\displaystyle E=\frac{d-2}{d-3}(TS-pA)+\phi Q\,,$ (82)

which is the Euler equation for the system of a $d$-dimensional electrically
charged black holes in a heat reservoir. By differentiating Eq. (82) and
considering that $dE=TdS-pdA+\phi dQ$, one obtains

$\displaystyle TdS-pdA+(d-2)(SdT-Adp)+(d-3)Qd\phi=0\,.$ (83)

which is the Gibbs -Duhem relation for the system of a $d$-dimensional
electrically charged black hole in a heat reservoir.

In the limit of infinite radius of the cavity, one can obtain the Smarr
formula from Eq. (82). Indeed, in the limit of infinite radius $R$, the
temperature in Eq. (34) reduces to the Hawking temperature, i.e., $T=T_{\rm
H}=\frac{d-3}{4\pi}\left(\frac{1}{r_{+}}-\frac{\lambda
q^{2}}{r_{+}^{2d-5}}\right)$, the electric potential in Eq. (35) reduces to
the electric potential of the Reissner-Nordström black hole, i.e.,
$\phi=\phi_{\rm H}=\frac{q}{(d-3)\Omega r_{+}^{d-3}}$, the quantity $pA$ with
$p$ in Eq. (78) being proportional to $\frac{1}{R^{d-3}}$ vanishes, and the
energy of the system in Eq. (79) reduces to the ADM mass, i.e., $E=m$,
Therefore, from Eq. (82) and from the considerations above, the Smarr formula
is given by

$\displaystyle m=\frac{d-2}{d-3}T_{\rm H}S+\phi_{\rm H}Q\,.$ (84)

The Smarr formula of Eq. (84) can only be valid for the small black hole
solution of the grand canonical ensemble, since it is the only solution that
exists in this limit.

###  IV.3 Stability in terms of thermodynamic variables

In a thermodynamic system with fixed size, fixed temperature, and fixed
electric potential, attached to a heat reservoir, energy, entropy, and
electric charge can flow from the system to the reservoir and back. In any
thermodynamic process in such a system, the grand canonical potential $W$
tends to decrease down to its minimum or stay at its minimum. In particular, a
spontaneous process in the grand canonical ensemble can never increase the
grand canonical potential $W$.

To see this one must resort to the second law of thermodynamics applied to the
total structure. Indeed, a variation $dS$ in entropy in the system, plus a
variation $dS_{\rm reservoir}$ in entropy of the reservoir, add to a variation
$dS_{\rm total}$ of the total entropy of the system plus reservoir, $dS_{\rm
total}=dS+dS_{\rm reservoir}$. Suppose the thermodynamic system absorbs energy
$dE$ and charge $dQ$ from the reservoir. Then the reservoir absorbs energy
$-dE$ and charge $-dQ$. The first law of thermodynamics then states that the
change in entropy in the reservoir is $TdS_{\rm reservoir}=-dE+\phi dQ$, where
since the reservoir remains in internal equilibrium by definition, its
temperature and its electric potential are kept constant, i.e., have the
original values $T$ and $\phi$. So, we can write for the total change in
entropy, $TdS_{\rm total}=TdS-dE+\phi dQ=-d(E-TS-\phi Q)=-d{\bar{W}}$, where
we used that $T$ and $\phi$ are constant since they are reservoir values. We
have also defined ${\bar{W}}$ as

$\displaystyle{\bar{W}}[{\bar{T}},A,{\bar{\phi}}]\equiv
E({\bar{T}},A,{\bar{\phi}})-TS({\bar{T}},A,{\bar{\phi}})-\phi
Q({\bar{T}},A,{\bar{\phi}})\,,$ (85)

as the grand canonical potential related to the nonequilibrium situation. Note
that due to the variation to a nonequilibrium situation the thermodynamic
system has in general a new temperature $\bar{T}$ and a new potential
$\bar{\phi}$ different from $T$ and $\phi$ of the reservoir. The new
quantities that arise in the variation of the nonequilibrium situation, $E$,
$S$, and $Q$, have the same functional form of ${\bar{T}}$, $A$, and
${\bar{\phi}}$, as they had of $T$, $A$, and $\phi$ before the nonequilibrium
process set in, but ${\bar{W}}[{\bar{T}},A,{\bar{\phi}}]$ has a different
functional form, since $T$ and $\phi$ that appear in Eq. (85) are quantities
of the heat reservoir fixed by assumption at the origin. The area $A$ has been
kept fixed in the process. Thus, returning to the total entropy, one has in
brief $TdS_{\rm total}=-d{\bar{W}}$. Since mandatorily $dS_{\rm total}\geq 0$
by the second law, one deduces $d{\bar{W}}\leq 0$. Any spontaneous process
decreases the grand canonical potential. For further discussion on these
issues see Sec. 8.2 and the following sections of reif .

The equilibrium is assured if

$\displaystyle{\bar{T}}=T\,,\quad\quad{\bar{\phi}}=\phi\,,$ (86)

in which case ${\bar{W}}$ is at its minimum. To be stable, fluctuations in the
temperature $T$ of the thermodynamic system should tend to increase $W$,
fluctuations in the electric potential $\phi$ should tend to increase $W$, and
a mixture of the two fluctuations should tend to increase $W$. So, stability
is assured if

$\displaystyle\left(\frac{\partial^{2}{\bar{W}}}{\partial{\bar{T}}^{2}}\right)_{{\bar{\phi}},A}>0\,,$
(87)
$\displaystyle\left(\frac{\partial^{2}{\bar{W}}}{\partial{\bar{T}}^{2}}\right)_{{\bar{\phi}},A}\left(\frac{\partial^{2}{\bar{W}}}{\partial{\bar{\phi}}^{2}}\right)_{{\bar{T}},A}-\left(\frac{\partial^{2}{\bar{W}}}{\partial{\bar{T}}\partial{\bar{\phi}}}\right)_{{\bar{T}};{\bar{\phi}},A}^{2}>0\,,$
(88)
$\displaystyle\left(\frac{\partial^{2}{\bar{W}}}{\partial{\bar{\phi}}^{2}}\right)_{{\bar{T}},A}>0\,,$
(89)

where in the second term of Eq. (88) the cross derivatives are performed
maintaining constant the quantity that is not being differentiated, and all
the derivatives are to be calculated at the solutions of the ensemble.
Additionally, only two conditions from Eqs. (87)-(89) are sufficient, we
choose Eqs. (87) and (88). From the expression of ${\bar{W}}$, one can show
that
$\left(\frac{\partial^{2}{\bar{W}}}{\partial{\bar{T}^{2}}}\right)_{A,{\bar{\phi}}}=\left(\frac{\partial
S}{\partial T}\right)_{A,\phi}$, where the bars have been dropped on the
right-hand side of the equality because $S$ has the same functional form of
${\bar{T}}$, $A$, and ${\bar{\phi}}$, as it has of $T$, $A$, and $\phi$, and
at equilibrium ${\bar{T}}=T$ and the area was never perturbed. In the same
manner,
$\left(\frac{\partial^{2}{\bar{W}}}{\partial{\bar{\phi}}^{2}}\right)_{{\bar{T}},A}=\left(\frac{\partial
Q}{\partial\phi}\right)_{T,A}$, and
$\left(\frac{\partial^{2}{\bar{W}}}{\partial{\bar{T}}\partial{\bar{\phi}}}\right)_{{\bar{T}};{\bar{\phi}},A}=\left(\frac{\partial
Q}{\partial T}\right)_{A,\phi}=\left(\frac{\partial
S}{\partial\phi}\right)_{T,A}$. The two sufficient conditions, Eqs. (87) and
(88), can then be written as

$\displaystyle\left(\frac{\partial S}{\partial T}\right)_{A,\phi}>0\,,$ (90)
$\displaystyle\left(\frac{\partial
Q}{\partial\phi}\right)_{T,A}\left(\frac{\partial S}{\partial
T}\right)_{A,\phi}-\left(\frac{\partial S}{\partial\phi}\right)^{2}_{T,A}>0\,$
(91)

respectively.

We now define two quantities. First, we define the isochoric heat capacity at
constant electric potential as

$\displaystyle C_{A,\phi}=T\left(\frac{\partial S}{\partial
T}\right)_{A,\phi}\,.$ (92)

Second, we define the adiabatic electric susceptibility as
$\chi_{S,A}=\left(\frac{\partial Q}{\partial\phi}\right)_{S,A}$. It can also
be written in terms of the derivatives present in Eq. (91) from a change of
variables $Q(T,A,\phi)$ to $Q(T(S,A,\phi),A,\phi)$, where $T(S,A,\phi)$ is the
inverse function of $S(T,A,\phi)$. Indeed, one gets

$\displaystyle\chi_{S,A}=\frac{\left(\frac{\partial
Q}{\partial\phi}\right)_{T,A}\left(\frac{\partial S}{\partial
T}\right)_{A,\phi}-\left(\frac{\partial
S}{\partial\phi}\right)^{2}_{T,A}}{\left(\frac{\partial S}{\partial
T}\right)_{A,\phi}}\,,$ (93)

So, the two stability conditions, Eqs. (90) and (91), are now

$\displaystyle C_{A,\phi}>0\,,$ (94) $\displaystyle\chi_{S,A}C_{A,\phi}>0\,,$
(95)

respectively. This analysis to obtain the stability conditions is equivalent
to the requirement that the matrix of variances in the grand canonical
ensemble is positive definite. This matrix contains the variances $\Delta
E^{2}$, $\Delta Q^{2}$ and the correlation $\Delta E\Delta Q$, where $E$ and
$Q$ are the quantities that are exchanged with the heat reservoir. By working
out the conditions of positive definiteness, one recovers also the conditions
Eqs. (94) and (95).

For the electrically charged black hole in the cavity, one can compute Eq.
(93) to find $\chi_{S,A}=\frac{(d-3)\Omega
r_{+}^{d-3}(1-\frac{r_{+}^{d-3}}{R^{d-3}})}{(1-(1-\Phi^{2})(\frac{r_{+}}{R})^{d-3})^{\frac{3}{2}}}$.
This adiabatic susceptibility is positive for all physical configurations of
the charged black hole. Therefore, the two conditions for stability are
reduced to a single one given in Eq. (94), $C_{A,\phi}>0$. Now,
$C_{A,\phi}=\frac{\Omega(d-2)Tr_{+}^{d-3}}{4}\frac{\partial r_{+}}{\partial
T}$, where $\frac{\partial r_{+}}{\partial T}$ can be computed, such that Eq.
(94) yields

$\displaystyle C_{A,\phi}=\frac{A(d-3)^{2}(d-2)x^{d-4}(1-\Phi^{2})^{2}}{32(\pi
RT)^{2}((d-1)(1-\Phi^{2})x^{d-3}-2)}>0\,\,,$ (96)

with the dependence on the variable $x=\frac{r_{+}}{R}$ being maintained for
readability. With Eq. (96) we recover Eq. (66) for thermodynamic stability.
See also Appendix C for further thermodynamic relations. We note that for the
case of $\Phi^{2}=0$, $C_{A,\phi}$ becomes the heat capacity at constant area
$C_{A}$ with the expression given in Andre:2021 . In this uncharged case, the
bifurcation and marginal stability radius and the photon sphere radius are the
same. A comparison between the bifurcation and marginal stability radius and
the photon sphere radius is done in Appendix A, showing that these radii do
not coincide. This means that the connection displayed in the uncharged case
is not generic, it holds only in the pure gravitational situation.

A comparison with the self-gravitating static electrically charged thin shell
in $d$-dimensions studied in Fernandes:2022  is worth doing. Indeed, it is
remarkable that the thermodynamic pressure given in Eq. (78) and the
thermodynamic energy given in Eq. (79) in the grand canonical ensemble have
the same expression as the matter pressure and the matter rest mass, or rest
energy, of the corresponding self-gravitating charged spherical shell in
equilibrium. Additionally, by choosing for the matter of the thin shell the
equations of state corresponding to the temperature and electric potential of
the black hole, the shell will also have the Bekenstein-Hawking entropy and
its stability at constant area is given by the same condition, i.e., positive
heat capacity at constant electric potential.

###  IV.4 Most favorable thermodynamic phase and phase transitions

In a thermodynamic system characterized by the grand canonical potential $W$,
it happens that all spontaneous processes always occur in the sense of
decreasing $W$. The configuration we are studying is a black hole inside a
reservoir characterized by a fixed area $A$, a fixed temperature $T$, and a
fixed electric potential $\phi$. So, thermodynamically $W$ is the most suited
thermodynamic potential to use in this problem. One feature here is that,
there are no restrictions on the energy $E$, and on the electric charge $Q$,
which can flow through the boundary with area $A$. Thus, it is relevant to
know whether the stable black hole is the thermodynamic state with less energy
$W$, or there is another state to which the black hole can make a phase
transition. One sees that now one uses the thermodynamic language, and so uses
phase transitions instead of quantum transitions as we did previously. But the
results are the same, as here one uses $W$ instead of $I_{0}$, with
$TI_{0}=W$. We summarize the results using the grand canonical potential $W$.

In the uncharged case, one has $W_{\rm hot\,flat\,space}=0$ and so the black
hole is favored or not depending on whether the black hole with horizon radius
$r_{+2}$ has a $W$ lower or greater than zero. It has been found that the
radius where $r_{+2}$ yields $W=0$ is equal to the Buchdahl radius, $r_{\rm
Buch}$. For radii $r_{+2}$ higher than $r_{\rm Buch}$ the black hole is
favored. In the electrically charged case, one has $W_{\rm
hot\,flat\,space}=0$, and corresponds to a cavity without a black hole and
without charge. One can emulate hot flat space by a tiny electric hot sphere
in flat space to find $W_{\rm hot\,sphere}$, tends to zero as the radius of
the sphere tends to zero. So, essentially, in this setting the black hole is
favored when its $W$ is less than zero. It is found that the radius where
$r_{+2}$ yields $W=0$ is not related to the Buchdahl-Andréasson-Wright radius,
a generalization for the Buchdahl radius to any higher dimension $d$ that
includes electric charge, see Appendix A. There is also the extreme black hole
solution localized at the radius of the cavity. It is found that the stable
black hole $r_{+2}$ has always lower or equal $W$ than $W_{\rm
extreme\,black\,hole}$, and therefore the stable black hole is always more
favorable than the extremal black hole with horizon at the cavity.

##  V The case $d=5$: Zero loop approximation and thermodynamics

###  V.1 $d=5$ in the zero loop approximation

####  V.1.1 Reduced action

Here we apply the whole formalism to $d=5$ dimensions. The $d=4$ case is done
in the Appendix D where a comparison with Braden:1990  is carried out. In
$d=5$, the reduced action taken from Eq. (30) is

$\displaystyle I_{*}=\frac{3\pi}{4}\beta
R^{2}\left(1-\sqrt{f}\right)-q\beta\phi-\frac{\pi^{2}r_{+}^{3}}{2}\,,$ (97)

where

$\displaystyle
f=\left(1-\frac{r_{+}^{2}}{R^{2}}\right)\left(1-\frac{1}{3\pi^{3}}\frac{q^{2}}{r_{+}^{2}R^{2}}\right).$
(98)

with $I_{*}=I_{*}[\beta,\phi,R;r_{+},q]$ and $f=f[R;r_{+},q]$. For $d=5$, one
has $\Omega=2\pi^{2}$ and, since $\lambda=\frac{8\pi}{(d-2)(d-3)\Omega^{2}}$,
one has $\lambda=\frac{1}{3\pi^{3}}$, which are quantities that have been used
and will be used along this section.

####  V.1.2 Stationary points and analysis of the stationary points

The horizon radius solutions $r_{+}$ obey a relation given by Eq. (43) which
for $d=5$ becomes

$\displaystyle(1-\Phi^{2})\left(\frac{r_{+}}{R}\right)^{4}-\left(\frac{r_{+}}{R}\right)^{2}+(1-\Phi^{2})^{2}\frac{1}{(2\pi
RT)^{2}}=0\,,$ (99)

where here $\gamma=(2\pi RT)^{2}\frac{\Phi^{2}}{(1-\Phi^{2})^{2}}$. The
electric charge $q^{2}$ obeys a relation given by Eq. (44) which now turns
into

$\displaystyle\frac{\absolutevalue{q}}{R^{2}}=2\sqrt{3}\,\pi^{\frac{5}{2}}\,\frac{RT\absolutevalue{\Phi}}{1-\Phi^{2}}\left(\frac{r_{+}}{R}\right)^{3}\,.$
(100)

Clearly, the stationary points, i.e., the solutions for the horizon radius
$r_{+}$ and the electric charge $q$ are functions of $T$, $\Phi$, and $R$,
i.e., one has $r_{+}=r_{+}(T,\Phi,R)$ and $q=q(T,\Phi,R)$.

Since Eq. (99) can be reduced to a quadratic equation, a property of $d=5$,
one can obtain from Eqs. (99) and (100) the analytic expressions for the
$r_{+}$ and $q$ of the two stationary points that yield the two electrically
charged black hole solutions. The first stationary point or solution,
$r_{+1}$, is the small black hole and is given by

$\displaystyle\frac{r_{+1}}{R}=\frac{1}{\sqrt{2(1-\Phi^{2})}}\left[1-\sqrt{1-\frac{(1-\Phi^{2})^{3}}{(\pi
RT)^{2}}}\right]^{\frac{1}{2}}\,,$ (101)
$\displaystyle\frac{\absolutevalue{q_{1}}}{R^{2}}=\sqrt{\frac{3}{2}}\,\frac{\pi^{\frac{5}{2}}RT\Phi}{(1-\Phi^{2})^{\frac{5}{2}}}\left[1-\sqrt{1-\frac{(1-\Phi^{2})^{3}}{(\pi
RT)^{2}}}\right]^{\frac{3}{2}}\,,$ (102)

This solution $r_{+1}$ given in Eq. (101) with negative sign in the square
root was designated $x_{1}$ in Sec. III.2.2. Here, we keep the $r_{+1}$
notation. The second stationary point or solution, $r_{+2}$, is the large
black hole and is given by

$\displaystyle\frac{r_{+2}}{R}=\frac{1}{\sqrt{2(1-\Phi^{2})}}\left[1+\sqrt{1-\frac{(1-\Phi^{2})^{3}}{(\pi
RT)^{2}}}\right]^{\frac{1}{2}}\,,$ (103)
$\displaystyle\frac{\absolutevalue{q_{2}}}{R^{2}}=\sqrt{\frac{3}{2}}\,\frac{\pi^{\frac{5}{2}}RT\Phi}{(1-\Phi^{2})^{\frac{5}{2}}}\left[1+\sqrt{1-\frac{(1-\Phi^{2})^{3}}{(\pi
RT)^{2}}}\right]^{\frac{3}{2}}\,.$ (104)

The solution $r_{+2}$ given in Eq. (103) with positive sign in the square root
was designated by $x_{2}$ in Sec. III.2.2. Here, we keep the $r_{+2}$
notation. The condition for the two black hole solutions to exist is given by
Eq. (52), which reduces to

$\displaystyle 0\leq(1-\Phi^{2})^{3}\leq(\pi RT)^{2}<\infty\,,$ (105)

in $d=5$ dimensions. For zero electric charge and so $\Phi=0$, i.e., the
uncharged case, Eq. (105) turns into $1\leq(\pi RT)^{2}<\infty$ of the $d=5$
Schwarzschild-Tangherlini black hole, see Andre:2020 .

Before embarking in a careful analysis of the stationary points, it is useful
to make an analysis of the limits. First, for very large $\pi RT$, $(\pi
RT)^{2}\to\infty$, independently of $\Phi$, the solution $r_{+1}$ behaves as
$\frac{r_{+1}}{R}\rightarrow\frac{(1-\Phi^{2})}{2\pi RT}$, and since
$\absolutevalue{\Phi}<1$ the solution always exists. For very large $\pi RT$,
$(\pi RT)^{2}\to\infty$, independently of $\Phi$, the solution $r_{+2}$
behaves as $\frac{r_{+2}}{R}\rightarrow\frac{1}{\sqrt{1-\Phi^{2}}}$, which for
values of $\Phi^{2}<1$, as it is always the case, one has $r_{+2}>R$, so the
solution is unphysical. This situation is different from the uncharged case,
where the solution with larger mass, $r_{+2}$, only meets the cavity at
infinite temperature, while in the charged case, the solution $r_{+2}$ meets
the cavity at finite temperature, as we are seeing here. Second, for
$\Phi^{2}\rightarrow 1$, independently of $(\pi RT)^{2}$, the solution
$r_{+1}$ tends to $r_{+1}\rightarrow 0$. For $\Phi^{2}\rightarrow 1$,
independently of $(\pi RT)^{2}$, the solution $r_{+2}$ tends to
$r_{+2}\rightarrow\infty$, and so is unphysical.

A careful analysis of the stationary points presented in solution $r_{+1}$ of
Eqs. (101)-(102) and in solution $r_{+2}$ of Eqs. (103)-(104) is now given.
Several plots are made in Figs. 2$-$4 that complement Eqs. (101)-(105) and the
main text. Note that $\frac{d-3}{d-1}=\frac{1}{2}$ in $d=5$, and so from Eq.
(54) one has that the value $\Phi^{2}=\frac{1}{2}$ plays an important role in
the analysis. Thus, we divide the analysis into two parts, namely,
$0\leq\Phi^{2}\leq\frac{1}{2}$ and $\frac{1}{2}<\Phi^{2}<1$.

(i) For $0\leq\Phi^{2}\leq\frac{1}{2}$, there are three branches.

(a) For $0\leq(\pi RT)^{2}<(1-\Phi^{2})^{3}$, there are no stationary points,
and so no black hole solutions, only hot flat space, see below.

(b) For $(1-\Phi^{2})^{3}\leq(\pi
RT)^{2}\leq\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}$, both black hole solutions lie
inside the cavity, i.e., $r_{+1}\leq R$ and $r_{+2}\leq R$. In the case of the
equality on the right side, i.e., $(\pi
RT)^{2}=\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}$, the solution $r_{+1}$ obeys
$r_{+1}<R$, and the solution $r_{+2}$ satisfies $r_{+2}=R$ with the charge
$q_{2}$ obeying $\absolutevalue{q_{2}}=\sqrt{3\pi^{3}}\,r_{+}^{2}$, i.e., it
is maximal, which means that the $r_{+2}$ solution is an extremal electrically
charged black hole. The particular case $\Phi^{2}=\frac{1}{2}$ yields that
$(1-\Phi^{2})^{3}=\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}=\frac{1}{8}$, so that
$(\pi RT)^{2}=\frac{1}{8}$, and now the $r_{+1}$ and $r_{+2}$ solutions merge
into one, an extremal electrically charged black hole that obeys
$r_{+1}=r_{+2}=R$.

(c) For $\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}<(\pi RT)^{2}<\infty$, the solution
$r_{+1}$ has always $r_{+}<R$ and so exists. For $\Phi$ near zero, $r_{+1}$ is
small and as the value of $(\pi RT)^{2}$ increases $r_{+1}$ goes to zero. For
$\Phi$ near $\frac{1}{2}$ from below, $r_{+1}$ is near $R$ and as $(\pi
RT)^{2}$ increases $r_{+1}$ goes to zero. On the other hand, the solution
$r_{+2}$ obeys $r_{+2}>R$, so is unphysical. This situation is different from
the uncharged case, where the solution with larger mass, $r_{+2}$, only meets
the cavity at infinite temperature, while in the charged case, the solution
$r_{+2}$ meets the cavity at finite temperature.

(ii) For $\frac{1}{2}<\Phi^{2}<1$, there are three branches.

(a) For $0\leq(\pi RT)^{2}<(1-\Phi^{2})^{3}$, there are no black hole
solutions, only hot flat space, see below.

(b) For $(1-\Phi^{2})^{3}\leq(\pi
RT)^{2}\leq\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}$, both solutions $r_{+1}$ and
$r_{+2}$ lie outside the cavity and so are unphysical. This means that within
this range there are no black hole solutions, presumably only hot flat space,
see below.

(c) For $\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}<(\pi RT)^{2}<\infty$, the solution
$r_{+1}$ starts at $r_{+1}=R$ in the case of $(\pi
RT)^{2}=\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}$ and then decreases towards zero as
the temperature increases. On the other hand, the solution $r_{+2}$ remains
outside the cavity and so is unphysical.

Figure 2: Top plot: Stationary points $\frac{r_{+1}}{R}=x_{1}$ (in blue) and
$\frac{r_{+2}}{R}=x_{2}$ (in red) of the reduced action $I_{*}$ as a function
of $RT$, for dimension $d=5$, and for five values of $\Phi$, namely,
$\Phi=0.001$ in dotted lines, $\Phi=0.2$ in dashed lines, $\Phi=0.4$ in solid
lines, $\Phi=0.6$ in dot dashed lines and $\Phi=\frac{1}{\sqrt{2}}=0.7$, the
last equality is approximate, in dot double dashed lines. Bottom plot:
Stationary points $\frac{r_{+1}}{R}=x_{1}$ (in blue) and
$\frac{r_{+2}}{R}=x_{2}$ (in red) of the reduced action $I_{*}$ as a function
of $\Phi$, for dimension $d=5$, and for five values of $RT$, namely, $RT=0.05$
in dotted lines, $RT=\frac{1}{2\sqrt{2}\pi}=0.112$, the last equality is
approximate, in dashed lines, $RT=0.2$ in solid lines,
$RT=\frac{1}{\pi}=0.318$, the last equality is approximate, in dot dashed
lines, and $RT=0.4$ in dot double dashed lines. The gray line corresponds to
the points $x$ and $\Phi$ where the solutions $x_{1}$ and $x_{2}$ coincide.
The orange line corresponds to $\Phi=1$, which is the maximum possible
electric potential. See text for further details. Figure 3: Contour plot of
the reduced action in $d=5$ dimensions, specifically of $\frac{4I_{*}}{3\pi
R^{2}}$, in function of $\frac{r_{+}}{R}=x$ and
$\frac{\absolutevalue{q}}{\sqrt{3\pi^{3}}R^{2}}=\sqrt{y}$, for $\Phi=0.2$ and
$RT=0.4$. The blue dot is a saddle point and corresponds to
$\frac{r_{+1}}{R}=x_{1}$, and the red dot is a minimum and corresponds to
$\frac{r_{+2}}{R}=x_{2}$. See text for further details.

In Fig. 2 top, the plots of the two stationary points $\frac{r_{+1}}{R}$ and
$\frac{r_{+2}}{R}$ given in Eqs. (101) and (103) as functions of $RT$ for five
values of $\Phi$ are shown. In Fig. 2 bottom, the plots of the two stationary
points $\frac{r_{+1}}{R}$ and $\frac{r_{+2}}{R}$ given in Eqs. (101) and (103)
as functions of $\Phi$ for five values of $RT$ are shown. In these plots, the
quantity $\Phi$ was chosen instead of $\phi$ so that the comparison between
the analytical study and the plots is straightforward. $\Phi$ is proportional
to $\phi$, specifically in $d=5$ one has $\Phi=\sqrt{\frac{16\pi}{3}}\phi$,
then $\Phi$ is fixed as $\phi$ is fixed.

In Fig. 3, a contour plot of the reduced action $I_{*}$, given in Eq. (97),
for $RT=0.5$ and $\Phi=0.2$, as a function of $\frac{r_{+}}{R}=x$ and
$\frac{\absolutevalue{q}}{\sqrt{3\pi^{3}}R^{2}}=\sqrt{y}$, displays the two
stationary points $\frac{r_{+1}}{R}=x_{1}$ and $\frac{r_{+2}}{R}=x_{2}$ in
this case. One can see the nature of the stationary points in the contour
plot, with $r_{+1}$ being a saddle point and $r_{+2}$ being a minimum, this is
proven generally in the next section. Although the effect on the contour plot
for other values of $RT$ and $\Phi$ is not plotted here, we present in the
next plot the effect on the migration of the stationary points.

In Fig. 4 top, the migration path

Figure 4:  Top part: Path of the solutions $\frac{r_{+1}}{R}=x_{1}$ (in blue)
and $\frac{r_{+2}}{R}=x_{2}$ (in red) in the $x\times\sqrt{y}$ plane, for
$d=5$, with $x$ and $\sqrt{y}$ parameterized by $RT$, for $\Phi=0.03$ in
dotted lines, $\Phi=0.2$ in dashed lines, $\Phi=0.5$ in solid lines and
$\Phi=\frac{1}{\sqrt{2}}=0.707$, the last equality being approximate, in dot
dashed lines. The gray line corresponds to extremal black holes, i.e.,
$\sqrt{y}=x^{2}$. The black line corresponds to the points $x$ and $\sqrt{y}$
where $x_{1}$ and $x_{2}$ coincide. Bottom part: Path of solutions $x_{1}$ (in
blue) and $x_{2}$ (in red) in the $x\times\sqrt{y}$ plane, for $d=5$, with $x$
and $\sqrt{y}$ parameterized by $\Phi$, for $RT=\frac{1}{2\sqrt{2}\pi}=0.11$,
the last equality being approximate, in dotted line, $RT=0.25$ in dashed
lines, $RT=\frac{1}{\pi}=0.3$, the last equality being approximate, in solid
lines, and $RT=0.4$ in dot dashed lines. The gray line corresponds to the
condition of extremal black holes, i.e., $\sqrt{y}=x^{2}$. The black line
corresponds to the points $x$ and $\sqrt{y}$ where $x_{1}$ and $x_{2}$
coincide. See text.

of the two stationary points $\frac{r_{+1}}{R}=x_{1}$ and
$\frac{r_{+2}}{R}=x_{2}$ from a point in the central region where they
coincide to the two points at the corners is shown as a function of $RT$ for
four different values of $\Phi$. The gray line corresponds to the condition of
extremal black holes, namely, $\sqrt{y}=x^{2}$, i.e.,
$\frac{|q|}{\sqrt{3\pi^{3}}}=r_{+}^{2}$. The black line corresponds to the
points $x$ and $\sqrt{y}$ where the solutions $x_{1}$ and $x_{2}$ coincide.
For the minimum possible temperature in each case, the solutions are at the
black line, and as one increases the temperature, $x_{1}$ decreases towards
the origin $x=\sqrt{y}=0$, where $RT\rightarrow+\infty$, and $x_{2}$ increases
towards $x=\sqrt{y}=1$, where
$RT\rightarrow\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}$. In Fig. 4 bottom, the
migration path of the two stationary points $\frac{r_{+1}}{R}=x_{1}$ and
$\frac{r_{+2}}{R}=x_{2}$ from a point in the central region where they
coincide to the two points at the corners is shown as a function of $\Phi$ for
four different values of $RT$. In these plots, the quantity $\Phi$ was chosen
instead of $\phi$ so that the comparison between the analytical study and the
plots is straightforward. Since $\Phi=\sqrt{\frac{16\pi}{3}}\phi$, one has
that $\Phi$ is fixed as $\phi$ is fixed. The gray line corresponds to the
condition of extremal black holes, namely $\sqrt{y}=x^{2}$, i.e.,
$\frac{|q|}{\sqrt{3\pi^{3}}}=r_{+}^{2}$. The black line corresponds to the
points $x$ and $\sqrt{y}$ where solutions $x_{1}$ and $x_{2}$ coincide. For
minimum potential, the solutions either start from the black line where the
solutions coincide or start separated in $\sqrt{y}=0$ line. As one increases
the potential, $x_{1}$ tends to the origin $x=\sqrt{y}=0$, where
$\Phi\rightarrow 1$, and $x_{2}$ tends to $x=\sqrt{y}=1$, where
$\Phi\rightarrow\sqrt{(\pi RT)^{2}+1}-\pi RT$.

####  V.1.3 Perturbations around the zero loop approximation and stability
analysis

Using Eq. (66) with $x\equiv\frac{r_{+}}{R}$, one finds that the solutions are
stable when

$\displaystyle\frac{\left(4(1-\Phi^{2})\left(\frac{r_{+}}{R}\right)^{2}-2\right)\left(1-\left(\frac{r_{+}}{R}\right)^{2}\right)}{(1-(1-\Phi^{2})\left(\frac{r_{+}}{R}\right)^{2})}>0\,\,,$
(106)

for $d=5$. The physical range is $\frac{r_{+}}{R}<1$. Therefore, the solutions
are stable if $r_{+}>r_{+\rm bif}$, where $r_{+\rm
bif}=\frac{R}{\sqrt{2(1-\Phi^{2})}}$ is the bifurcation radius from which the
solutions $r_{+2}$ and $r_{+1}$ bifurcate at $(\pi RT)^{2}=(1-\Phi^{2})^{3}$.
So, one has always that $r_{+1}<r_{+\rm bif}<r_{+2}$.

We can spell the consequences of Eq. (106) in more detail. For $r_{+1}$, this
means that for $(1-\Phi^{2})^{3}\leq(\pi
RT)^{2}\leq\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}$, in the case
$0\leq\Phi^{2}\leq\frac{1}{2}$, the solution does not obey the stability
condition, and so is thermodynamically unstable, and in the case
$\frac{1}{2}<\Phi^{2}<1$ the solution $r_{+1}$ does not physically exist as it
lies outside the cavity. For $\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}<(\pi
RT)^{2}<\infty$ and $0\leq\Phi^{2}<1$, the solution $r_{+1}$ does not obey the
stability condition, and so is thermodynamically unstable. Moreover, $r_{+1}$
corresponds to a saddle point of the action. For $r_{+2}$, this means that for
$(1-\Phi^{2})^{3}\leq(\pi RT)^{2}\leq\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}$, in
the case $0\leq\Phi^{2}\leq\frac{1}{2}$, the solution obeys the stability
condition, therefore for this range of parameters the solution is
thermodynamically stable, and it is also a minimum of the action. In the case
$\frac{1}{2}<\Phi^{2}<1$ the solution $r_{+2}$ does not physically exist, as
it lies outside the cavity. For $\frac{(1-\Phi^{2})^{2}}{4\Phi^{2}}<(\pi
RT)^{2}<\infty$ and $0<\Phi^{2}<1$ the solution $r_{+2}$ does not physically
exist also, being located outside the cavity.

####  V.1.4 Most probable configurations

We now want to make a study of the most probable configurations in the case
$d=5$. For that, we deal with stable solutions only. The system with less
$I_{0}$, which is found from $I_{*}$ in Eq. (97) and its stationary points, is
the most probable system since it gives the most important contribution to the
partition function $Z$.

To search for the most probable configuration, one has essentially to make a
comparison of the stable black hole with a charged equivalent hot flat space.
The action has two stable stationary points, namely, the stationary point
$r_{+2}$ related to the stable black hole, and the stationary point $r_{+}=0$
and $q=0$, which corresponds to a cavity without a black hole and without
charge. The action also has a critical point, $r_{+}=R$ and
${\frac{q}{\sqrt{3\pi^{3}}}}=R$, so that
$r_{+}={\frac{q}{\sqrt{3\pi^{3}}}}=R$, which corresponds to an extremal black
hole with the horizon localized at the radius of the cavity.

To have a model for the stationary point $r_{+}=0$ and $q=0$, we have proposed
that a nongravitating perfect conductor hot sphere with radius $r_{\rm hs}$,
inside the reservoir at constant $\beta$ and $\phi$, will do. The electric
potential is now $\phi=\frac{q}{4\pi^{2}}\left(\frac{1}{r_{\rm
hs}^{2}}-\frac{1}{R^{2}}\right)$, see also Eq. (35). So that the action for a
hot sphere, as a model of hot flat space, in five dimensions is

$\displaystyle I_{\rm
hot\,sphere}=-\frac{1}{2}\,\frac{4\pi^{2}}{\frac{1}{r_{\rm
hs}^{2}}-\frac{1}{R^{2}}}\beta\phi^{2}\,.$ (107)

One can then compare the action of the conducting hot sphere given in Eq.
(107) with the action of the stable configuration of the charged black hole
given in Eq. (97) together with Eqs. (103) and (104). Clearly, from Eq. (107)
one sees that for small $r_{\rm hs}$, which is the case analogous to hot flat
space, then $I_{\rm hot\,sphere}=0$, or approximately zero, so that
essentially $I_{\rm hot\,sphere}=I_{\rm hot\,flat\,space}$ in this case.

Now, the stable black hole has positive action only in a small range of low
temperatures, namely, for temperatures near the minimum temperature for which
the stable black hole exists. For higher temperatures, the action for the
stable black hole is negative. Therefore, one finds that the small charged
sphere that emulates hot flat space is less probable for a large interval of
temperatures when compared with the stable black hole. In fact, when the
solution of the stable black hole obeys

$\displaystyle\frac{r_{+2}}{R}\geq\mu
m+\sqrt{\mu^{2}m^{2}-\frac{q^{2}}{3\pi^{3}}}\,,$ (108)

with $\mu=\frac{4}{3\pi}$, see Eq. (23), and with $\mu
m=-\frac{9}{16}+\frac{15}{16}\sqrt{1+\frac{16}{27\pi^{3}}\frac{q^{2}}{R^{4}}}$
the corresponding action is negative and the black hole is more probable than
the tiny charged sphere. Note that this radius $r_{+2}$ does not have a
connection to the Buchdahl-Andréasson-Wright bound, in contrast to the
uncharged case, see also Appendix A for more details.

The comparison between the hot flat sphere and the stable black hole is
displayed in Fig. 5. In the two plots of

Figure 5:  Regions of more probability in five dimensions, $d=5$, between the
stable black hole solution and the charged conducting sphere, in function of
$RT$ and $\Phi$. Top plot: $\frac{r_{\rm hs}}{R}\to 0$. The region in gray
represents the points where the black hole solution is more probable or
favorable. The region in purple represents the points where the infinitesimal
charged conducting sphere, emulating electrically charged hot flat space, is
more probable. The regions in white do not have a stable black hole solution,
so presumably the most probable state is hot flat space. Bottom plot:
$\frac{r_{\rm hs}}{R}=0.99$. The region in gray represents the points where
the black hole solution is more probable. The region in blue represents the
points where the charged conducting sphere is more probable, with
$\frac{r_{\rm hs}}{R}=0.99$. The regions in white do not have a stable black
hole solution, so presumably the most probable state is hot flat space.

the figure, the gray region represents the points of the pair $(RT,\Phi)$ in
which the stable black hole solution $r_{+2}$ is more probable. The region in
purple in the top plot of the figure, and in blue in the bottom plot,
represents the points in which the charged conducting sphere with radius
$r_{\rm hs}$ is more probable. The regions in white represent points where
there is no stable black hole solution, so presumably the most probable state
is hot flat space. The upper white region is different from the uncharged
case, see Andre:2021 , because in the uncharged case the stable black hole
solution exists for temperatures up to infinite ones, whereas in the
electrically charged case, the stable black hole solution only exists within a
range of finite temperature. In the top plot of Fig. 5, we can see that the
lower the value of $r_{\rm hs}$, the larger the region where the stable black
hole solution is more probable over the conducting sphere, until the point
where one has a microscopic sphere. In that case, the whole of the region
favors the stable black hole solution, apart from a very small region where
the microscopic sphere is more probable, see Eq. (108). This case of a
microscopic electrically charged sphere is the case that emulates hot flat
space. In the bottom plot of Fig. 5, we can see that the higher the value of
$r_{\rm hs}$, the smaller the region where the stable black hole solution is
more probable, but this case is contrived, does not emulate hot flat space.
Moreover, it must be stated that for relatively small values of $r_{\rm hs}$,
the region of probability for the electrically charged shell does not change
much, as even with $r_{\rm hs}=0.7$, the difference to $r_{\rm hs}=0$ is
small. Indeed, only variations of $r_{\rm hs}$ close to $R$ changes
substantially the region of the most probable state. Note also that for the
uncharged case, in $d=5$, the comparison between the stable black hole
solution and hot flat space was made in Andre:2020 . The stable black hole and
the hot flat space solution are the stationary points of the reduced action.
The most probable state is the one with the lowest value of the action. In the
case of the black hole, the value of the action $I_{0}$ depends on $\beta$,
while in the case of hot flat space one has $I_{\rm hot\,flat\,space}=0$. In
Andre:2020 , it was shown that $I_{0}<I_{\rm hot\,flat\,space}$ if $\beta$ is
such that $\frac{r_{+}}{R}>\frac{r_{\rm Buch}}{R}$, where $r_{\rm Buch}$ is
the Buchdahl radius. Thus, in the pure gravitational case the size of the
horizon radius for the black hole to be the dominant phase coincides with the
Buchdahl radius. This agreement does not extend to when other fields are
present, since the horizon radius for the electrically charged black hole to
be the dominant phase does not coincide with the Buchdahl-Andréasson-Wright
radius, as we have shown.

In $d=5$ one can make now a specific comparison of the stable black hole
$r_{+2}$ with the critical point given by $r_{+}=R$ and
$\frac{q}{\sqrt{3\pi^{3}}}=R$, i.e., an extremal black hole with the horizon
localized at the radius of the cavity, bearing in mind that the precise
extremality and the precise location can fluctuate by Planck order quantities.
The gradient of the action is not defined at this critical point but it may be
smoothed up by taking in consideration higher loops in the path integral or a
different theory of gravity, see Appendix B. The action for this critical
point can be taken from Eq. (70) in the $d=5$ case, i.e., $I_{\rm
extreme\,black\,hole}=\frac{3\pi
R^{2}\beta}{4}\Bigl{(}1-\Bigr{.}\left.\sqrt{f(R,r_{+},q)}\right)-q\beta\phi-\frac{\pi^{2}r_{+}^{3}}{2}$,
where $f(R,r_{+},q)$ is taken from Eq. (27) putting $d=5$ with $r_{+}$ and $q$
having extremal values, so that $r_{+}=R$, $q=\sqrt{3\pi^{3}}\,R$, and
$f(R,r_{+},q)=0$. Then,

$\displaystyle I_{\rm extreme\,black\,hole}=\frac{3\pi
R^{2}\beta}{4}-\sqrt{3\pi^{3}}\,R^{2}\beta\phi-\frac{\pi^{2}R^{3}}{2}\,.$
(109)

So $I_{\rm extreme\,black\,hole}$ has to be analyzed for each $R$ and $\beta$
and compared with the action for the stable black hole $r_{+2}$. It is found
that, in every instance, the stable black hole is a more probable
configuration than the extreme black hole with horizon at the cavity.

###  V.2 Thermodynamics of the $d=5$ Reissner-Nordström space in a cavity

####  V.2.1 Relation between action and grand canonical potential

In any dimension $d$, in particular in $d=5$, the grand potential $W$ has the
dependence $W=W[T,\phi,A]$, where here $A$ is the surface area of the
$3$-sphere at the boundary $\mathcal{B}$. The correspondence between
thermodynamics and the action of the system is given by Eq. (72), i.e.,
$W[T,\phi,A(R)]=T\,I_{0}[T,\phi,R]$. So, here one has

$\displaystyle W=$
$\displaystyle\frac{3\pi}{4}R^{2}\left(1-\sqrt{\left(1-\frac{r_{+}^{2}}{R^{2}}\right)\left(1-\frac{1}{3\pi^{3}}\frac{q^{2}}{r_{+}^{2}R^{2}}\right)}\right)$
$\displaystyle-T\,\frac{\pi^{2}r_{+}^{3}}{2}-q\phi\,,$ (110)

see Eqs. (97) and (98). The grand potential still has the expression
$W=E-ST-Q\phi$, with $dW=-SdT-Qd\phi-pdA$ and with the first law of
thermodynamics $TdS=dE-\phi dQ+pdA$ holding, see Eq. (72).

####  V.2.2 Charge, mean energy, and pressure, first law of thermodynamics,
and Euler equation, Gibbs -Duhem relation, and Smarr formula

The physical quantities of the system such as the entropy, electric charge,
surface pressure, thermodynamic energy, and area can be given in this case.

The entropy can be directly obtained from Eq. (76) in $d=5$

$\displaystyle S=\frac{1}{4}A_{+}\,,$ (111)

which is the Bekenstein-Hawking entropy of a black hole, where indeed
$S=\frac{\pi^{2}r_{+}^{3}}{2}$, with $A_{+}=2\pi^{2}r_{+}^{3}$.

The electric charge can be computed from Eq. (77). In $d=5$, it has the same
appearance as in general $d$, i.e., for given $T$, $\phi$, and $R$, one has
$Q=q$, the electric charge of Reissner-Nordström space.

The gravitational thermodynamic surface pressure at $R$ can be calculated from
Eq. (78) to give

$\displaystyle p=\frac{1}{8\pi R\sqrt{f}}$
$\displaystyle\left(\left(1-\sqrt{\left(1-\frac{r_{+}^{2}}{R^{2}}\right)\left(1-\frac{q^{2}}{3\pi^{3}r_{+}^{2}R^{2}}\right)}\right)^{2}\right.$
$\displaystyle\Big{.}-\frac{q^{2}}{3\pi^{3}R^{4}}\Biggr{)}\,,$ (112)

where $f$ is given in Eq. (98). This tangential surface pressure acts along an
area $A$ that in $d=5$ is $A=2\pi^{2}R^{3}$, see Eq. (10).

The mean thermodynamic energy can be taken from Eq. (79) to the $d=5$ case and
is

$\displaystyle E=\frac{3\pi
R^{2}}{4}\left(1-\sqrt{\left(1-\frac{r_{+}^{2}}{R^{2}}\right)\left(1-\frac{q^{2}}{3\pi^{3}r_{+}^{2}R^{2}}\right)}\right)\,.$
(113)

This is the same expression as the quasilocal energy evaluated at a spherical
shell of radius $R$.

The first law of thermodynamics, $TdS=dE+pdA-\phi dQ$ given in Eq. (80), for
the system in $d=5$ holds, of course.

From Eq. (113), one can write the energy in terms of the entropy $S$ of Eq.
(111), electric charge $Q$, and surface area of the cavity $A$, as

$\displaystyle E=$
$\displaystyle\frac{3(2\pi^{2})^{\frac{1}{3}}A^{\frac{2}{3}}}{8\pi}\times$
$\displaystyle\left(1-\sqrt{\left(1-\left(\frac{4S}{A}\right)^{\frac{2}{3}}\right)\left(1-\frac{Q^{2}(2\pi^{2})^{\frac{4}{3}}}{3\pi^{3}(4SA)^{\frac{2}{3}}}\right)}\right)\,.$
(114)

One can then use the Euler’s homogeneous function theorem considering that
under rescaling of its arguments, the energy as a function has the property
that $E\left(\nu S,\nu A,\nu
Q^{\frac{3}{2}}\right)=\nu^{\frac{2}{3}}E\left(S,A,Q^{\frac{3}{2}}\right)$. We
thus have an integrated version of the first law of thermodynamics given by,
see Eq. (82),

$\displaystyle\frac{2}{3}E=TS-pA+\frac{2}{3}\phi Q\,,$ (115)

which is the Euler equation for the system of a $d=5$ electrically charged
black hole in a heat reservoir. By differentiating Eq. (115) and considering
that $dE=TdS-pdA+\phi dQ$, one obtains

$\displaystyle TdS-pdA+3(SdT-Adp)+2Qd\phi=0\,.$ (116)

which is the Gibbs -Duhem relation for the $d=5$ electrically charged black
hole in a heat reservoir. Then, the Smarr formula in $d=5$ is

$\displaystyle m=\frac{3}{2}T_{\rm H}S+\phi_{\rm H}Q\,,$ (117)

see Eq. (84). Again, the Smarr formula is valid for the small black hole
solution only.

####  V.2.3 Equilibrium and stability in terms of thermodynamic variables

The heat capacity $C_{A,\phi}=T\left(\frac{\partial S}{\partial
T}\right)_{A,\phi}$ is given by Eq. (96). By setting $d=5$, one gets

$\displaystyle
C_{A,\phi}=\frac{3\left(\frac{r_{+}}{R}\right)\left(1-\Phi^{2}\right)^{2}}{8\pi\,T^{2}\left(2(1-\Phi^{2})\left(\frac{r_{+}}{R}\right)^{2}-1\right)}\,,$
(118)

where we have that $A$ is the area of the reservoir, and we have used
$x=\frac{r_{+}}{R}$. For the link between the validity of zero loop
approximation and the heat capacity, see Appendix C. So $C_{A,\phi}>0$ means

$\displaystyle 2(1-\Phi^{2})\left(\frac{r_{+}}{R}\right)^{2}-1>0\,.$ (119)

Therefore we recover Eq. (106).

####  V.2.4 Most favorable thermodynamic configurations

The most favorable thermodynamic configuration is found from the state with
the lowest value of the grand potential $W$. Since $W=TI_{0}$, the analysis is
the same if done in $I_{0}$ or in $W$. What changes is that in $I$ one talks
about the most probable state and about quantum transitions, and when using
$W$ one talks about the most favorable state and phase transitions. Since we
have done the analysis in detail for $I$ in $d=5$, it is not necessary to do
in $W$, we refer to Sec. V.1.4.

##  VI Conclusions

The grand canonical ensemble of a $d$-dimensional Reissner-Nordström space in
a cavity was built using the path integral approach. The partition function of
the space in a cavity was obtained by performing the zero loop approximation
to the path integral relative to the Euclidean action, where only the term
which minimizes the action contributes to the path integral. There are two
stationary points of the action that correspond to a black hole in equilibrium
with a heat reservoir with the temperature and the electric potential fixed at
the boundary of the cavity. The stationary point with lower horizon radius was
shown to be unstable, while the stationary point with higher horizon radius is
stable, as has been proved for arbitrary $d$. The corresponding values of the
event horizon radius depending on the temperature and electric potential of
the two stationary points cannot be found analytically for arbitrary
dimensions. However, it is possible to find analytically the event horizon
radius for $d=5$, where one needs to solve a quadratic polynomial.

There are some features of the stationary points in the electrically charged
case that differ from the electrically uncharged case. First, the event
horizon radius corresponding to the lowest temperature allowed does not
correspond to the photon sphere, unlike the uncharged case, thus showing that
this coincidence is really restricted to the pure gravitational case. Second,
the larger horizon radius solution reaches the radius of the cavity at finite
temperature, unlike the uncharged case. where the horizon radius only reaches
the cavity radius at infinite temperature.

The grand canonical ensemble of the stable stationary point can be constructed
by comparing the partition function given by the path integral with the
partition function of the grand canonical ensemble. The grand potential can be
obtained from the comparison and the thermodynamics of the black hole
corresponding to the stable stationary point is recovered. We have shown that
the entropy corresponds to the Bekenstein-Hawking entropy, the pressure
corresponds to the pressure of a self-gravitating static electrically charged
spherical thin shell in equilibrium, and the thermodynamic energy has the same
expression as the expression for the quasilocal energy. The first law of
thermodynamics with constant area is obeyed at the stationary points of the
action, as one would expect. The stability of the stationary points is
described by the heat capacity at constant area and electric potential. If
this heat capacity is positive, then the stationary point is stable. This fits
well with the relationship between thermodynamic stability and the heat
capacity.

Additionally, we have compared the stable black hole solution to an
electrically charged conducting hot sphere in flat space, to analyze when one
is more favorable than the other. In this case, a configuration is more
favorable than the other when its grand potential $W$ is lower. We have shown
that this depends on the value of the temperature, of the electric potential
of the reservoir, and of the radius of the conducting sphere. Moreover, the
smaller the radius of the conducting sphere, the larger the region where the
stable black hole is favored. The comparison of the Buchdahl-Andréasson-Wright
bound radius in $d$-dimensional Reissner-Nordström spacetimes with the minimum
radius for which the stable black hole phase is thermodynamically favored,
dictates that they have no relationship, thus showing that the connection
displayed in the Schwarzschild case is not generic, rather it is a very
restricted equality holding only in the pure gravitational situation.

## Acknowledgments

We thank financial support from Fundação para a Ciência e Tecnologia - FCT
through the project No. UIDB/00099/2020 and project No. UIDP/00099/2020

##  Appendix A Connection of thermodynamic radii to spacetime radii

###  A.1 Thermodynamic bifurcation radius and the photon sphere radius

In the case of the grand canonical ensemble of a $d$-dimensional Reissner-
Nordström black hole in a cavity, we have seen in Eq. (49) that the two
thermodynamic black hole solutions, represented by $r_{+1}$ and $r_{+2}$,
bifurcate from a horizon radius obeying
$\frac{r_{+}}{R}=\frac{2^{\frac{1}{d-3}}}{\left({(d-1)}(1-\Phi^{2})\right)^{\frac{1}{d-3}}}$,
or in terms of $R$,

$\displaystyle
R=\left(\frac{(d-1)}{2}(1-\Phi^{2})\right)^{\frac{1}{d-3}}r_{+}\,.$ (120)

A black hole for which the horizon radius $r_{+}$ satisfies Eq. (120) is
marginally stable to thermodynamic perturbations, black holes with larger
radius $r_{+}$ are thermodynamically stable. Thus, the bifurcation radius is
also the marginal thermodynamic stable radius.

The photon sphere radius $R$ of a $d$-dimensional Reissner-Nordström black
hole is given by, see Appendix E,

$\displaystyle
R=\left(\frac{(d-1)}{2}\left(1+\frac{d-3}{d-2}\Phi^{2}\right)\right)^{\frac{1}{d-3}}r_{+}\,.$
(121)

At this radius, null geodesics can have circular trajectories, and thus
photons can execute circular orbits.

From direct comparison between Eqs. (120) and (121), we see that the two radii
are distinct in any dimension $d$, so that in the grand canonical ensemble of
the Reissner-Nordström black hole there is no connection between them.

Of course, when there is no charge and so no $\Phi$, the two radii coincide as
Eqs. (120) and (121) both yield
$R=\left(\frac{d-1}{2}\right)^{\frac{1}{d-3}}r_{+}$, and so the radius of the
cavity at which a stable black hole appears corresponds to the photon sphere
radius.

Thus, we have verified that the equality between the bifurcation and marginal
stability radius and the photon orbit radius only holds in the pure
gravitational case, the equality does not extend to the grand canonical
ensemble of the $d$-dimensional Reissner-Nordström black hole.

###  A.2 Most favorable configuration radius and the Buchdahl-Andréasson-
Wright sphere radius

In the case of grand canonical ensemble of a $d$-dimensional Reissner-
Nordström black hole in a cavity, the stable solution has a negative action
$I_{0}$, see Eq. (37), or equivalently, a negative grand potential $W$, see
Eq. (73), if

$\displaystyle\frac{\mu m}{R^{d-3}}\leq-\frac{4(d-2)^{2}}{(d-1)^{2}(d-3)^{2}}$
$\displaystyle+\frac{2(d-2)((d-2)^{2}+1)}{(d-1)^{2}(d-3)^{2}}\sqrt{1+\frac{(d-1)^{2}(d-3)^{2}}{4(d-2)^{2}}\frac{\lambda
q^{2}}{R^{2d-6}}}\,.$ (122)

Note that this condition for $d=4$ is given by
$\frac{m}{R}\leq-\frac{16}{9}+\frac{20}{9}\sqrt{1+\frac{9}{16}\frac{q^{2}}{4\pi
R^{2d-6}}}$.

The Buchdahl-Andréasson-Wright bound yields the minimum radius, below which,
an electrically charged matter distribution obeying certain conditions, in
general relativity coupled to Maxwell electromagnetism in $d$ dimensions, the
spacetime is singular. This Buchdahl-Andréasson-Wright radius was obtained in
Wright:2015 . This radius and can also be found from our work with thin shells
Fernandes:2022  by imposing that the trace of the stress-energy tensor of the
matter in the thin shell is zero. The radius is given by

$\displaystyle\frac{m}{R^{d-3}}=\frac{d-2}{(d-1)^{2}}+\frac{1}{d-1}\frac{\lambda
q^{2}}{R^{2d-6}}$
$\displaystyle+\frac{d-2}{(d-1)^{2}}\sqrt{1+(d-1)(d-3)\frac{\lambda
q^{2}}{R^{2d-6}}}\,.$ (123)

For $d=4$, this is $\frac{\mu
m}{R}\leq\left(\frac{1}{3}+\sqrt{\frac{1}{9}+\frac{1}{3}\frac{\lambda
q^{2}}{R^{2}}}\right)^{2}$, i.e.,
$\frac{m}{R}\leq\frac{2}{9}+\frac{1}{3}\frac{q^{2}}{4\pi
R^{2}}+\frac{2}{3}\sqrt{\frac{1}{9}+\frac{1}{3}\frac{q^{2}}{4\pi R^{2}}}$.

From direct comparison between Eqs. (122) and (123), we see that the most
favorable configuration radius and the Buchdahl-Andréasson-Wright radius are
distinct in any dimension $d$, and so there is no connection between them.

Of course, when there is no charge, $q=0$, and so no $\Phi$, $\Phi=0$, both
radii are equal to Buchdahl radius. When $q=0$, one finds that Eqs. (122) and
(123) both yield
$\frac{r_{+}}{R}\geq\left(\frac{4(d-2)}{(d-1)^{2}}\right)^{\frac{1}{d-3}}$,
which is the Buchdahl radius. In this case, the stable solution has a negative
free energy if the radius of the black hole is larger than the Buchdahl
radius.

Thus, we have verified that the equality between the black hole radius for
which the stable solution has a zero $W$ and the Buchdahl-Andréasson-Wright
radius only holds in the pure gravitational case.

##  Appendix B Gradient of the action of the two critical points

###  B.1 Gradient of the action

The gradient of the action in Eq. (30) yields

$\displaystyle\frac{\mu}{R^{d-2}}\frac{\partial I_{*}}{\partial
x}=\frac{(d-3)\beta}{2Rx\sqrt{f}}\left[x^{d-3}-\frac{y}{x^{d-3}}\right]-2\pi
x^{d-3}\,,$ (124) $\displaystyle\frac{\mu}{R^{d-2}}\frac{\partial
I_{*}}{\partial\sqrt{y}}=\frac{\beta\sqrt{y}}{Rx^{d-3}\sqrt{f}}(1-x^{d-3})-\frac{\beta\Phi}{R}\,,$
(125)

where $x=\frac{r_{+}}{R}$, $y=\frac{\lambda q^{2}}{R^{2d-6}}$ and
$\Phi=(d-3)\Omega\sqrt{\lambda}\phi$.

###  B.2 Gradient of the action of hot flat space

Here we want to analyze the gradient of the action given in Eqs. (124) and
(125) at the critical point of hot flat space. For that, we calculate the
limit of the gradient for $x=y=0$ along the curve $y=(\eta)^{2}x^{2d-6}$,
where $\eta$ is a positive constant of the curve. Note that one must consider
$\eta<1$ so that the curve is inside the domain of the action. This family of
curves cover the possible directions from the point $x=y=0$ to the physical
domain of the action. The gradient is given by

$\displaystyle\frac{\mu}{R^{d-2}}\frac{\partial I_{*}}{\partial
x}=\frac{(d-3)\beta x^{d-4}}{2R}\left(1-\eta^{2}\right)\,,$ (126)
$\displaystyle\frac{\mu}{R^{d-2}}\frac{\partial
I_{*}}{\partial\sqrt{y}}=\frac{\beta}{R}\left(\eta-\Phi\right)\,.$ (127)

We have left the dependence in $x^{d-4}$ since it yields different limits for
the case of $d=4$ and $d>4$. Since the gradient depends on $\eta$, then the
gradient is undefined. Nevertheless, we can calculate the directional
derivative along the vector
$v=\frac{1}{\sqrt{1+(d-3)^{2}\eta^{2}x^{2d-8}}}(1,(d-3)\eta x^{d-4})^{T}$,
which will be given by

$\displaystyle D_{v}I_{*}=$ $\displaystyle\frac{(d-3)\beta
x^{d-4}}{2R}\left(1+\eta^{2}-2\eta\Phi\right)\,\,,$ (128)

so for $d>4$, we have that the directional derivative vanishes. Moreover, the
directional $(d-3)$th derivative is positive since $1+\eta^{2}-2\eta\Phi>0$
for $\eta<1$ and $\Phi\leq 1$, and so this can be considered as a minimum,
although formally the partial derivative in $\sqrt{y}$ is undefined. For $d=4$
case, the directional derivative does not vanish. Yet, since
$1+\eta^{2}-2\eta\Phi>0$ for $\eta<1$ and $\Phi\leq 1$, one can observe that
the directional derivative is positive in the physical domain. Therefore, the
action resembles a conical potential well at the origin and so hot flat space
can be considered as a solution.

###  B.3 Gradient of the action of the extremal black hole with horizon at the
cavity

The gradient of the action of the extremal black hole can be given by using
Eqs. (124) and (125). In order to study the gradient in the critical point
$x=1$ and $y=1$, we calculate the gradient of the action in this limit along
the curve $x^{d-3}=1-\epsilon$ and $y=1-\eta\epsilon$, where $\eta$ is a
constant of the curve and $\epsilon$ parameterizes the curve. The limit of
$\epsilon\rightarrow 0^{+}$ is then performed, yielding the gradient

$\displaystyle\frac{\mu}{R^{d-2}}\frac{\partial I_{*}}{\partial
x}=\frac{(d-3)\beta}{2R\sqrt{\eta-1}}(\eta-2)-2\pi\,,$ (129)
$\displaystyle\frac{\mu}{R^{d-2}}\frac{\partial
I_{*}}{\partial\sqrt{y}}=\frac{\beta}{R\sqrt{\eta-1}}-\frac{\beta\Phi}{R}\,,$
(130)

where $\eta>2$ so that the curve is done along configurations of subextremal
black holes, coming from the condition $y<x^{2d-6}$. Since there is a
dependence on the curve we choose to perform the limit, the gradient at the
extremal point is not defined.

It is interesting to see that for $\gamma=1$, i.e.,
$\beta=\frac{4\pi}{d-3}\frac{\absolutevalue{\Phi}}{1-\Phi^{2}}R$, the gradient
vanishes in the limit along a curve with
$\frac{1}{\eta}=1+\frac{1}{\Phi^{2}}$. Indeed, this set of temperatures
corresponds to the stable black hole solution hitting the extremal point
$x=y=1$. Of course, this only happens in one particular curve, the gradient is
still undefined.

It is also interesting to consider the directional derivative along these
curves, in the direction of smaller $\epsilon$. Indeed, the direction can be
described by the vector
$v=\frac{1}{\sqrt{1+(d-3)^{2}\eta^{2}/4}}(1,\frac{\eta(d-3)}{2})^{T}$, and so
the directional derivative yields

$\displaystyle\frac{\mu}{R^{d-2}}D_{v}I_{*}=\frac{\frac{\beta(d-3)}{2R}\left(2\sqrt{\eta-1}-\eta\Phi\right)-2\pi}{\sqrt{1+(d-3)^{2}\eta^{2}/4}}\,.$
(131)

The directional derivative depends also on $\eta$ and it can be positive or
negative. In particular, for values of $\eta$ and $\Phi$ where $\gamma_{\rm
bif}(\Phi,d)<\frac{4(\eta-1)\Phi^{2}}{(1-\Phi^{2})^{2}}\left(1-\frac{\eta}{2\sqrt{\eta-1}}\Phi\right)^{2}$
the directional derivative in Eq. (131) can be positive in a region
$\gamma_{\rm
bif}(\Phi,d)<\gamma<\frac{4(\eta-1)\Phi^{2}}{(1-\Phi^{2})^{2}}\left(1-\frac{\eta}{2\sqrt{\eta-1}}\Phi\right)^{2}$,
with $\gamma_{\rm bif}$ given in Eq. (50). Therefore, the action near this
critical point does not resemble a potential well.

##  Appendix C Further relations between canonical ensemble and thermodynamics

###  C.1 Extrema as first law of thermodynamics

The extrema of the reduced action and stability of the two solutions of
$r_{+}(\beta,\phi,R)$ and $q(\beta,\phi,R)$ was analyzed in Sec. III.2. Yet,
the physical interpretation of these extrema and stability does not seem
explicit. Let us do this interpretation with the help of the thermodynamic
variables.

We rewrite the reduced action in terms of the thermodynamic variables. If we
use $S$ of Eq. (76), $Q$ of Eq. (77), and $E$ of Eq. (79), Eq. (30) turns into

$\displaystyle I_{*}=\beta E-S-Q\beta\phi\,,$ (132)

where the functions $E$, $S$, and $Q$ are in a first moment seen as function
of $r_{+}$ and $q$, and noting that $r_{+}$ and $q$ here are not restricted.

The conditions for extrema of the action, and so of equilibrium, are given in
Eqs. (32) and (33). Now, in terms of $S$ and $Q$ one has $\left(\frac{\partial
I_{*}}{\partial r_{+}}\right)_{\beta,R,q}=\frac{\partial S}{\partial
r_{+}}\left(\frac{\partial I_{*}}{\partial S}\right)_{\beta,\phi,A,Q}$ and
$\left(\frac{\partial I_{*}}{\partial
q}\right)_{\beta,R,r_{+}}=\left(\frac{\partial I_{*}}{\partial
Q}\right)_{\beta,\phi,A,S}$. Since $\frac{\partial S}{\partial r_{+}}>0$ and
$\frac{\partial Q}{\partial q}=1$, Eqs. (32) and (33), i.e., $\frac{\partial
I_{*}}{\partial r_{+}}=0$ and $\frac{\partial I_{*}}{\partial q}=0$,
respectively, can now be rewritten as $\left(\frac{\partial I_{*}}{\partial
S}\right)_{\beta,\phi,A,Q}=0$ and $\left(\frac{\partial I_{*}}{\partial
Q}\right)_{\beta,\phi,A,S}=0$. Then using Eq. (132), one finds from these two
equations that $\beta\frac{\partial E}{\partial S}-1=0$ and
$\beta\left(\frac{\partial E}{\partial Q}-\phi\right)=0$, respectively, where
$\frac{\partial E}{\partial S}\equiv\left(\frac{\partial E}{\partial
S}\right)_{A,Q}$ and $\frac{\partial E}{\partial Q}\equiv\left(\frac{\partial
E}{\partial Q}\right)_{A,S}$, to simplify the notation. So, with
$\beta=\frac{1}{T}$, the extrema give the result

$\displaystyle\frac{\partial E}{\partial S}=T\,,$ (133)
$\displaystyle\frac{\partial E}{\partial Q}=\phi\,.$ (134)

Moreover, $E$ of Eq. (79), in the variables $A$ of Eq. (10), $S$ of Eq. (76),
and $Q$ of Eq. (77), is of the form $E=E(S,A,Q)$. It is then useful to define
a quantity, namely, thermodynamic pressure $p$, such that

$\displaystyle\frac{\partial E}{\partial A}=-p\,,$ (135)

where $\frac{\partial E}{\partial A}\equiv\left(\frac{\partial E}{\partial
A}\right)_{S,Q}$. Since by definition $dE=\frac{\partial E}{\partial
S}dS+\frac{\partial E}{\partial A}dA+\frac{\partial E}{\partial Q}dQ$, we
obtain from Eqs. (133)-(135) that

$\displaystyle dE=TdS-pdA+\phi dQ,$ (136)

which is the first law of thermodynamics. Therefore, the condition of extrema,
or of equilibrium, in the reduced action, is equivalent to impose the first
law of thermodynamics to the thermodynamic energy $E$.

The derivation of the first law of thermodynamics here relies on the fact that
the reduced action can be written as Eq. (132). As seen in Sec. IV, the
thermodynamic quantities obtained through the grand potential are indeed the
same as the ones considered here, since the extrema conditions are used.

###  C.2 Perturbations around the zero loop approximation and stability of the
action as thermodynamic stability

In the path integral, the stability for the extrema is given by the
requirement that the matrix ${I_{*0}}_{ij}$, whose components are given in
Eqs. (57)-(59), is positive definite. In thermodynamics, we have to deal with
second derivatives of $W$ for stability, Eqs. (87)-(88). Since $\beta W=I_{0}$
one should be able to confront and compare the results of the two formalism to
show their equivalence in this stability aspect.

For that we rewrite that a sufficient condition is

$\displaystyle{I_{*0}}_{r_{+}r_{+}}{I_{*0}}_{qq}-\left({{I_{*0}}_{r_{+}q}}\right)^{2}>0\,,$
(137)

see Eq. (64). So we have to find the components of the matrix ${I_{*0}}_{ij}$
by considering $I_{*}$ given by Eq. (132), noting that for $I_{*}$, $r_{+}$
and $q$ are not restricted. In addition, since we are making the
transformations from $r_{+}$ to $S$ and from $q$ to $Q$, specifically,
$S=\frac{\Omega r_{+}^{d-2}}{4}$ and $Q=q$, see Eqs. (76) and (77), we have to
relate the derivatives in $S$ to derivatives in $r_{+}$ and derivatives in $Q$
to derivatives in $q$. The action $I_{*}=I_{*}(r_{+},q;\beta,\phi,R)$ is now
given as $I_{*}=I_{*}(S(r_{+}),Q;\beta,\phi,R)$. It is understood that a
partial derivative of $I_{*}$ in order to either $S$ or $Q$ means we are
working with $I_{*}=I_{*}(S(r_{+}),Q;\beta,\phi,R)$. Also, we use the
transformation formulas $\frac{\partial P(S(r_{+}),q)}{\partial
r_{+}}=\frac{\partial S}{\partial r_{+}}\frac{\partial P(S(r_{+}),q)}{\partial
S}$ and $\frac{\partial^{2}P(S(r_{+}),q)}{\partial
r_{+}^{2}}=\frac{\partial}{\partial r_{+}}\left(\frac{\partial S}{\partial
r_{+}}\frac{\partial P(S(r_{+}),q)}{\partial
S}\right)=\frac{\partial^{2}S}{\partial r_{+}^{2}}\frac{\partial
P(S(r_{+}),q)}{\partial S}+\left(\frac{\partial S}{\partial
r_{+}}\right)^{2}\frac{\partial^{2}P(S(r_{+}),q)}{\partial S^{2}}$, where
$P(S(r_{+}),Q)$ stands for any of the functions of interest.

To calculate ${I_{*0}}_{r_{+}r_{+}}$ we have to calculate first
${I_{*}}_{r_{+}r_{+}}$ with $r_{+}$ and $q$ not restricted. So we have
${I_{*}}_{r_{+}r_{+}}=\frac{\partial^{2}S}{\partial r_{+}^{2}}\frac{\partial
I_{*}}{\partial S}+\left(\frac{\partial S}{\partial
r_{+}}\right)^{2}\frac{\partial^{2}I_{*}}{\partial S^{2}}$. Since the extrema
condition implies that $\frac{\partial I_{*}}{\partial r_{+}}=\frac{\partial
S}{\partial r_{+}}\frac{\partial I_{*}}{\partial S}=0$, we have then in the
new variable $\frac{\partial I_{*}}{\partial S}=0$. Putting this in the
calculation above for ${I_{*}}_{r_{+}r_{+}}$ and restricting $r_{+}$ and $q$
to the extrema, we have

$\displaystyle{I_{*0}}_{r_{+}r_{+}}=\left(\frac{\partial S}{\partial
r_{+}}\right)^{2}_{0}\left(\frac{\partial^{2}I_{*}}{\partial
S^{2}}\right)_{0}\,,$ (138)

where the prefix $0$ means the derivative is evaluated at the extrema. To
calculate ${I_{*0}}_{r_{+}q}$, we start as well with ${I_{*}}_{r_{+}q}$. The
quantity ${I_{*}}_{r_{+}q}$ in the new variables is
${I_{*}}_{r_{+}q}=\frac{\partial S}{\partial
r_{+}}\frac{\partial^{2}I_{*}}{\partial Q\partial S}$, where the derivatives
in $I_{*}$ can be interchangeable and it has been used that $S=S(r_{+})$ as it
does not depend on $q$ or $Q$. Evaluating at the extrema, we have then

$\displaystyle{I_{*0}}_{r_{+}q}=\left(\frac{\partial S}{\partial
r_{+}}\right)_{0}\left(\frac{\partial^{2}I_{*}}{\partial Q\partial
S}\right)_{0}\,.$ (139)

To calculate ${I_{*0}}_{qq}$, it is straightforward since $q=Q$ that the
correspondent quantity in new variables is

$\displaystyle{I_{*0}}_{qq}=\left(\frac{\partial^{2}I_{*}}{\partial
Q^{2}}\right)_{0}\,.$ (140)

With all the quantities in the new variables, the stability condition, Eq.
(137), can be written as

$\displaystyle\left(\frac{\partial^{2}I_{*}}{\partial
S^{2}}\right)_{0}\left(\frac{\partial^{2}I_{*}}{\partial
Q^{2}}\right)_{0}-\left(\frac{\partial^{2}I_{*}}{\partial S\partial
Q}\right)^{2}_{0}>0\,,$ (141)

where we have divided by $\left(\frac{\partial S}{\partial
r_{+}}\right)^{2}_{0}$ since it is positive.

To turn this condition, Eq. (141), into a condition on thermodynamic
quantities, we recall our previous results. Starting by
$\left(\frac{\partial^{2}I_{*}}{\partial S^{2}}\right)_{0}$, we have that
$\left(\frac{\partial^{2}I_{*}}{\partial
S^{2}}\right)_{0}=\left(\frac{\partial}{\partial S}\left(\beta\frac{\partial
E}{\partial S}-1\right)\right)_{0}=\beta\frac{\partial^{2}E}{\partial
S^{2}}=\beta\left(\frac{\partial T}{\partial
S}\right)_{A,Q}=\frac{1}{C_{A,Q}}$, where Eq. (133) was used and the heat