The change in free energy between states A and B can thus be computed from the integral of the ensemble averaged derivatives of potential energy over the coupling parameter λ λ . In practice, this is performed by defining a potential energy function U ( λ λ ) , sampling the ensemble of equilibrium configurations at a series of λ λ values, calculating the ensemble-averaged derivative of U ( λ λ ) with respect to λ λ at each λ λ value, and finally computing the integral over the ensemble-averaged derivatives.