There has to be an integral missing in your book citation, line 2 of $\Delta A =\ldots$ should read $\Delta A = \beta^{-1} \ln \left[\int \exp{-\beta[U_1(\vec x) - U_0(\vec x)]} P_0(\vec x) d \vec x \right]$. Other than that, the calculation is as follows:
$$\begin{align*} \Delta A &=-\beta^{-1} \ln \frac{\int \exp[-\beta U_1(\vec{x})] d\vec{x}}{\int exp[-\beta U_0(\vec{x})] d\vec{x}} &= -\beta^{-1} \ln \frac{\int \exp[-\beta U_1(\vec{x})] \frac{\exp(\beta U_0(\vec x))}{\exp(\beta U_0(\vec x))} d\vec{x}}{\int \exp[-\beta U_0(\vec{x})] d\vec{x}} \\ &= -\beta^{-1} \ln \frac{\int \exp[-\beta [U_1(\vec{x}) - U_0(\vec x)]] \exp[-\beta U_0(\vec x)] d\vec{x}}{\int \exp[-\beta U_0(\vec{x})] d\vec{x}} \\ &= -\beta^{-1} \ln \frac{\int \exp[-\beta [U_1(\vec{x}) - U_0(\vec x)]] \exp[-\beta U_0(\vec x)] d\vec{x}}{Z_0} \\ &= -\beta^{-1} \ln \int \exp[-\beta [U_1(\vec{x}) - U_0(\vec x)]] p_0(\vec x) d\vec{x} \\ &= -\beta^{-1} \ln \langle\exp[-\beta [U_1(\vec{x}) - U_0(\vec x)]] \rangle \end{align*}$$$$\begin{align*} \Delta A &=-\beta^{-1} \ln \frac{\int \exp[-\beta U_1(\vec{x})] d\vec{x}}{\int exp[-\beta U_0(\vec{x})] d\vec{x}} \\ \\ &= -\beta^{-1} \ln \frac{\int \exp[-\beta U_1(\vec{x})] \frac{\exp(\beta U_0(\vec x))}{\exp(\beta U_0(\vec x))} d\vec{x}}{\int \exp[-\beta U_0(\vec{x})] d\vec{x}} \\ \\ &= -\beta^{-1} \ln \frac{\int \exp[-\beta [U_1(\vec{x}) - U_0(\vec x)]] \exp[-\beta U_0(\vec x)] d\vec{x}}{\int \exp[-\beta U_0(\vec{x})] d\vec{x}} \\ \\ &= -\beta^{-1} \ln \frac{\int \exp[-\beta [U_1(\vec{x}) - U_0(\vec x)]] \exp[-\beta U_0(\vec x)] d\vec{x}}{Z_0} \\ \\ &= -\beta^{-1} \ln \int \exp[-\beta [U_1(\vec{x}) - U_0(\vec x)]] p_0(\vec x) d\vec{x} \\ \\ &= -\beta^{-1} \ln \langle\exp[-\beta [U_1(\vec{x}) - U_0(\vec x)]] \rangle \end{align*}$$
Long, faulty latex story short: multiply the integrand in the nominator by $1=\frac{\exp[\beta U_0(\vec x)]}{\exp[\beta U_0(\vec x)]}$, unite the two "top" exponentials, convert $\frac{1}{\exp[\beta U_0(\vec x)]} = \exp[-\beta U_0(\vec x)]$ which , with $Z_0$ from the big denominator, gives $P_0(\vec x)$ and write the integral as the ensemble average.