Gravitational action for BTZ black hole I am trying to calculate the gravitational action for a BTZ black hole (ie a Schwarzschild-AdS black hole with spacetime dimension D=3). Below I go through my working.
$ds^2 = l^2fd\tau^2 + l^2f^{-1}dr^2 + l^2r^2d\phi^2$
$f(r) = r^2 - 8M \implies r_h^2 = 8M$, $l$ = AdS radius.
The metric is from equation (2.23) of http://www.hartmanhep.net/topics2015/gravity-lectures.pdf.
See equation (6.21) in http://www.hartmanhep.net/topics2015/6-GravityPathIntegral.pdf for the following.
$n^a = [0, -f^{1/2}/l,0]$, the inward pointing unit normal to the boundary surface at $r = r_0$. A strange observation is that if this was the outward pointing unit normal, then we would find $S_E = 0$.
$K_{\mu\nu} = \frac{1}{2}n^\alpha\partial_\alpha g_{\mu\nu} = -\frac{1}{2}\frac{f^{1/2}}{l^2}\partial_r g_{\mu\nu} = -\frac{f^{1/2}}{2l}diag(2l^2r, \frac{-2rl^2}{f^2}, 2rl^2)$.
$\implies K_{ab} = \frac{f_0^{1/2}}{2l}diag(2l^2r_0, 2r_0l^2)$, where $r_0$ will be the cut-off radius.
Note $a,b$ are taking values $\tau$ and $\phi$.
$h_{ab}dx^adx^b = l^2f_0d\tau^2 + l^2 r_0^2d\phi^2$, which is the induced metric on the boundary surface of constant $r = r_0$.
$K = h^{ab}K_{ab} = -(\frac{r_0}{lf_0^{1/2}} + \frac{f_0^{1/2}}{r_0l})$, which is the extrinsic curvature of the boundary surface.
$\sqrt{h}K = -2lr_0^2+8Ml$.
$R-2\Lambda = -4/l^2$ and $\sqrt{g} = l^3r$.
$S_E = -\frac{1}{16\pi}\int_0^\beta d\tau \int_{r_h}^{r_0} dr \int_0^{2\pi} d\phi \sqrt{g}(R-2\Lambda) -\frac{1}{8\pi}\int_0^\beta d\tau\int_0^{2\pi} d\phi \sqrt{h}K + \frac{a}{8\pi}\int_0^\beta d\tau\int_0^{2\pi} d\phi\sqrt{h}$, where $a$ is chosen to cancel the divergence.
I end up with $S_E = -4l\beta M$. Now I can use the general result $\beta = \frac{4\pi l^2}{f'(r_h)} \implies M = \frac{\pi^2 l^2}{2\beta^2}$. If I try to calculate the average energy $E = -\partial_\beta ln(Z) = \partial_\beta S_E$, I get $E = 4lM$. The following link http://www.hartmanhep.net/topics2015/gravity-lectures.pdf above equation (6.21) seems to suggest I should have found $E = M^2/8$. Further, I find the entropy to be $S = (1-\partial_\beta)ln(Z) = -(1-\partial_\beta)S_E = 4\pi l\sqrt{2M}$, which I believe should have been $S = 4\pi l \sqrt{\frac{M}{8}}$.
Have I done anything wrong in this calculation?
 A: Here is the correct calculation for the action of the BTZ black hole.
Set $l = 1$, let $f(r) = r^2 - 8M$. ($l$ is the AdS radius).
$g = fd\tau^2 + f^{-1}dr^2 + r^2d\phi^2$. (Initial metric).
$h = f_0d\tau^2 + r_0^2d\phi^2$. (Induced metric on boundary surface at $r = r_0$).
$n_\alpha = [0, f_0^{-1/2}, 0]$. (Outward looking unit normal to boundary surface at $r = r_0$, the components are $\tau, r, \phi$ in that order).
$K_{\mu\nu} = \nabla_{(\mu}n_{\nu)} = \frac{1}{2}(\partial_\mu n_\nu + \partial_\nu n_\mu - 2\Gamma^\sigma_{\mu\nu}n_\sigma)$. (Instrinsic curvature to boundary surface).
The first two terms in $K_{\mu\nu}$ are only non-zero when $\mu = \nu = r$ and so we can ignore them since we want $K = h^{\mu\nu}K_{\mu\nu}$ and $h^{rr} = 0$. To see the latter we use $h_{\mu\nu} = g_{\mu\nu} - n_\mu n_\nu \implies h^{rr} = g^{rr}g^{rr}(g_{rr}-n_rn_r) = 0$ using $n_r = f^{-1/2}$.
$\Gamma^r_{\tau\tau} = -rf, \Gamma^r_{\phi\phi} = -rf$. (To calculate Christoffel symbols using python see link in https://takisangelides.wixsite.com/personal/teaching).
$K = h^{\mu\nu}K_{\mu\nu} = h^{\tau\tau}K_{\tau\tau} + h^{\phi\phi}K_{\phi\phi} = r_0f^{-1/2}_0 + \frac{f_0^{1/2}}{r_0}$, using $K_{\tau\tau} = -\Gamma^r_{\tau\tau}n_r$ and $K_{\phi\phi} = -\Gamma^r_{\phi\phi}n_r$.
$\sqrt{h}K = 2r_0^2-8M$, $R-2\Lambda = -4$, $\sqrt{g} = r$.
$S_E = -\frac{1}{16\pi}\int_0^\beta d\tau \int_{r_h}^{r_0} dr \int_0^{2\pi} d\phi \sqrt{g}(R-2\Lambda) -\frac{1}{8\pi}\int_0^\beta d\tau\int_0^{2\pi} d\phi \sqrt{h}K + \frac{a}{8\pi}\int_0^\beta d\tau\int_0^{2\pi} d\phi\sqrt{h}.$
$S_E = -\beta M$.
For the above I have used $a = 1$ and $r_h = \sqrt{8M}$.
We now use the general result $\beta = \frac{4\pi}{f'(r_h)}$ to get $\beta = \frac{\pi}{\sqrt{2M}}$.
Using $S_E = -ln(Z)$, $E = \partial_\beta S_E$, $S = (-1+\beta \partial_\beta)S_E$, we get $E = M$ and $S = \pi\sqrt{2M} = \frac{\pi r_h}{2}$, which are the expected results.
