On the potential energy of a piezoelectric inclusion and the criterion for ferroelectric switching