# Expected value estimation when sampled with another hamiltonian

I have written down some relationship that I do not know where it comes from. I wish to know how to derive it.

Let $X$ be a property of a classical system. Suppose that we can sample it while the system evolve according to the hamiltonian $H_0$. We are interested in the expected value of $X$ when it evolves through the hamiltonian $H_1 = H_0 + \Delta H$, ($\langle X \rangle_{H_1}$), where $\Delta H$ does not modify too much the dynamics of the system. I know that it can be computed using

$$\langle X \rangle_{H_1} = \frac{\langle X e^{-\Delta H /(kT)}\rangle_{H_0}}{\langle e^{-\Delta H /(kT)}\rangle_{H_0}}$$

where $\langle \cdot \rangle_{H_0}$ denotes the evolution under the hamiltonian $H_0$

The question is: How to derive that equation?

$$\langle X \rangle_{H_1} = \frac{\int X e^{-\beta H_1}d\lbrace q \rbrace}{\int e^{-\beta H_1}d\lbrace q \rbrace} = \frac{\int X e^{-\beta (H_0 + \Delta H)}d\lbrace q \rbrace}{\int e^{-\beta (H_0 + \Delta H)}d\lbrace q \rbrace} = \frac{\int X e^{-\beta \Delta H} e^{-\beta H_0} d\lbrace q \rbrace}{\int e^{-\beta \Delta H} e^{-\beta H_0} d\lbrace q \rbrace} = \frac{\langle X e^{-\beta \Delta H}\rangle_{H_0}}{\langle e^{-\beta \Delta H}\rangle_{H_0}}$$
Note that, strictly speaking, there are no approximations involved in this derivation, and hence $\Delta H$ can be as large as you want. However, the relation above is useful only when the values of $\Delta H$ that contribute the most to the integrals can be sampled with the original Hamiltonian, i.e. when $\Delta H$ is in fact a small perturbation.