General expression for the efficiency of phase-matched and nonphase-matched second-order nonlinear interactions between plane waves