Variation of domain functionals