Differentiate the energy and use the chain rule:
After integration by parts, the middle term is . Therefore
by the defocusing semilinear wave equation. Thus the total energy is conserved.