writing the potential energy as depending on a continuous parameter, 
one has the exact result 
This can either be directly verified from definitions or seen from the limit of the above Gibbs-Bogoliubov inequalities when 
we can therefore write
which is the thermodynamic integration (or TI) result. It can be approximated by dividing the range between states A and B into many values of λ at which the expectation value is estimated, and performing numerical integration.