Non-local terms in the elastic free energy of distorted nematic