k_x -\cos
\displaystyle{\frac{K_y}{2}}\cos k_y
\nonumber \\
&&~~~~~~~~~~~-\cos\frac{K_z}{2}\cos k_z)~~~~~~(d=3).
\nonumber\\
\label{md2es}\end{aligned}$$ We scale the parameter $z$ as $$z=\left\{
\begin{array}{l}
\hphantom{1}8t(\zeta +1 +i\epsilon)~~~~~~(d=2)\\
12t(\zeta +1 +i\epsilon)~~~~~~(d=3),
\end{array}
\right.$$ so that in both cases the energy band runs from $\zeta=-1$ to $\zeta=1$.

In two dimensions we find with (\[rint\]) $$\begin{aligned}
{\cal R}_2(\zeta,\vec{K})&=&\frac{1}{(2\pi)^2}
\int_{-\pi}^{\pi}dk_y\int_
{0}^{\pi} dk_x \, \frac{1}{8t} \left[\zeta+i\epsilon
+ \frac{1}{2}\left(
\cos\frac{K_x}{2}\cos k_x
+\cos\frac{K_y}{2}\cos k_y \right)
\right]^{-1}
\nonumber\\
&=& \frac{1}{32t\pi} \int_{-\pi}^{\pi}dk_y \frac{f(A,B)}{
\sqrt{|A^2-B^2|}},
\label{2dr}\end{aligned}$$ where $$\begin{aligned}
A&=& \zeta+\frac{1}{2} \cos\frac{K_y}{2}\cos k_y,\nonumber\\
B&=& \frac{1}{2}\cos\frac{K_x}{2},
\label{AB}\end{aligned}$$ and $$f(A,B)=\left\{
\begin{array}{ll}
\mathop{\rm sgn} (A) &~~(A^2>B^2)\\
-i &~~(A^2<B^2).
\end{array}
\right.
\label{f}$$ The integral in (\[2dr\]) can be expressed in terms of complete elliptic integrals of the first kind (see appendix). This gives an analytic expression for ${\cal R}_2(\zeta,\vec{K})$.

This expression can also be used to find the result in three dimensions, $${\cal R}_3(z,\vec{K})=\frac{1}{(2\pi)^3} \int_{-\pi}^{\pi} dk_z
\int_{-\pi}^{\pi} dk_y \int_0^{\pi} dk_x\left[
z-4t(3-\cos\frac{K_x}{2}\cos k_x
-\cos\frac{K_y}{2}\cos k_y
-\cos\frac{K_z}{2}\cos k_z)\right]^{-1}
\label{3drz}$$ or $$\begin{aligned}
{\cal R}_3(\zeta,\vec{K})&=&\frac{1}{2\pi} \int_{-\pi}^{\pi} dk_z
\frac{1}{32t\pi} \int_{-\pi}^{\pi}dk_y\int_0^{\pi} dk_x \left[
\widetilde{\zeta} +i\epsilon \vphantom{\frac{1}{2}}
+\frac{1}{2}(
\cos\frac{K_x}{2}\cos k_x +\cos\frac{K_y}{2}\cos k_y)\right]^{-1}
 \nonumber\\
&=& \frac{1}{2\pi}\int_{-\pi}^{\pi} dk_z {\cal R}_2(
\widetilde{\zeta},K_x,
K_y),
\label{r3}\end{aligned}$$ where $$8t(\widetilde{\zeta} +1)=12t(\zeta+1)-4t(1-\cos\frac{K_z}{2}
\cos k_z).
\label{tilde}$$ Using the analytic expression found for ${\cal R}_2$, ${\cal R}_3$ can be calculated by numerical integration of (\[r3\]).

The next step 