This paper uses a new algorithm namely biogeography based optimization (BBO) intended for the simultaneous placement of the distributed generation (DG) units and the capacitor banks in the distribution network. The procedure of optimization has been conducted in the presence of nonlinear loads (a cause of harmonic injection). The purpose of simultaneous optimal placement of the DG and the capacitor is the reduction of active and reactive losses. The difference in the values of loss reduction at different levels of the load have been included in the objective function and the considered objective function includes the constraints of voltage, size and the number of DG units and capacitor banks and the allowable range of the total harmonic distortion (THD) of the total voltage in accordance with the IEEE 519 standards. In this paper the placement has been performed on two load types