A derivation of formulas for the optical confinement factors for semiconducting lasers is made by directly calculating the relation between the mode gain and the material gain based on Maxwell's equations. Comparisons of the optical confinement factor formulas with the standard definition underestimates the mode gain of TE modes and overestimates that of TM modes. For TE modes, the correction factor reduces to the ratio of active region refractive index to the mode refractive index. The correction is important for the design polarization insensitive semiconductor laser amplifiers. It is also found that the optical confinement factor of vertical cavity surface-emitting lasers can be defined as the proportion of power flow in the active region to the total power flow.