On the determination of hypervirial theorems