Studying the first law of black-hole thermodynamics How to study the first law of thermodynamics in a charged case. The first law (as you know) can be written as
$
dM = T dS + \Phi dq.
$
Now the thing is, $S$ contains both $r_+$ (horizon radius) and $Q^2=q^2/(4\pi)$. 
 How should I fix the entropy and find $dM/dq$ to test the validity of (the electrodynamical part of) the first law here?
 A: The first law of thermodynamics for the Reissner Nordstrom spacetime is
$$dM = TdS + \Phi dQ.$$
The Reissner-Nordstrom metric is
$$g_{tt}=g_{rr}^{-1}=1-\frac{2M}{r}+\frac{Q^2}{r^2}.$$
At the horizon one has the condition:
$$g_{tt}(r_h)=0\to M=\frac{Q^2+r_h^2}{2 r_h}$$
The horizon area of the black hole gives the entropy
$$S(r_h) = A/4 = 4\pi r_h^2/4=\pi r_h^2 \to r_h = \frac{\sqrt{S}}{\sqrt{\pi }}$$
while the temperatre is given, from the concept of surface gravity (and since we have $g_{tt}=g_{rr}^{-1}$) as
$$T(r_h) = \frac{g_{tt}'(r_h)}{4\pi} = -\frac{Q^2-M r_h}{2 \pi  r_h^3}$$
and substitutung the mass parameter from the horizon condition we obtain
$$T(r_h) = \frac{r_h^2-Q^2}{4 \pi  r_h^3}$$
and as a function of the entropy
$$T(S,Q) = \frac{S-\pi  Q^2}{4 \sqrt{\pi } S^{3/2}} $$
Now, we can epxress the mass parameter in terms of the entropy
$$M(S,Q) = \frac{\pi  Q^2+S}{2 \sqrt{\pi } \sqrt{S}}$$
and taking the differential
$$dM(S,Q) = \frac{\partial M}{\partial S}dS + \frac{\partial M}{\partial Q}dQ.$$
Then it is easy to verify that
$$\frac{\partial M}{\partial S} = T = \frac{S-\pi  Q^2}{4 \sqrt{\pi } S^{3/2}}$$
and
$$\frac{\partial M}{\partial Q} = \frac{\sqrt{\pi } Q}{\sqrt{S}}$$
which expressing it as a function of the horizon to undertand it better
$$\frac{\partial M}{\partial Q} = \frac{Q}{r_h} = \Phi$$
which is indeed the electric flux measured by an observer at infinity with respcet to the horizon see P-V criticality of charged AdS black holes section 3A.
Therefore, the first law of thermodynamics holds. I hope this satisfies the OP on how we check the validity of the first law.
