Calculations of the bending potentials of MgOH and BeOH