The scalar‐product expression of boundary free energy for long‐range interacting systems