First from the second identity, let solve it in terms of $\epsilon$ and generate some other useful equations:
$$\gamma-1=\frac{\epsilon}{mc^{2}}\quad\gamma+1=\frac{\epsilon}{mc^{2}}+2$$
$$\frac{\gamma+1}{\gamma-1}=1+2\frac{mc^{2}}{\epsilon}$$
$$\frac{\gamma-1}{\gamma}=\frac{\frac{\epsilon}{mc^{2}}}{\frac{\epsilon}{mc^{2}}+1}=\left(1+\frac{mc^{2}}{\epsilon}\right)^{-1}$$
So now notice, if we substitute $p$ into the integral (ignoring arguments, assumed to be $\epsilon$) we get:
$$P=\frac{1}{3}\int_{0}^{\infty}n\gamma mv^{2}d\epsilon$$
which depends on the square of $v$. We solve the third identity for $v^2$ in term of $\gamma$:
$$v^{2}=c^{2}\left(1-\frac{1}{\gamma^{2}}\right)$$
Now we can solve for the term inside the integral, which gives:
$$\begin{aligned}
\gamma mv^{2} &=\gamma mc^{2}\left(1-\frac{1}{\gamma^{2}}\right) \\
&=\gamma^{-1}mc^{2}\left(\gamma^{2}-1\right) \\
&=\epsilon\left(1+\frac{mc^{2}}{\epsilon}\right)^{-1}\left(1+2\frac{mc^{2}} {\epsilon}\right)
\end{aligned}
$$
where in the last step the previously determined identities were used:
$$\begin{aligned}
\gamma^{-1}\left(\gamma^{2}-1\right) &=\gamma^{-1}\left(\gamma-1\right)\left(\gamma+1\right)\\
&=\left(\gamma-1\right)\left(\frac{\gamma-1}{\gamma}\right)\left(\frac{\gamma+1}{\gamma-1}\right)\\
&=\frac{\epsilon}{mc^{2}}\left(1+\frac{mc^{2}}{\epsilon}\right)^{-1}\left(1+2\frac{mc^{2}}{\epsilon}\right)
\end{aligned}$$
Substituting this result into the integral gives the form of the integral found in the book.