This paper proposes a method for determining the optimal sites and sizes of multi-type distributed generations (DG) and capacitors for minimizing reactive power losses (RPL) in distribution systems. The proposed method is developed based on generic closed-form analytical expressions for calculating optimal sizes of DG units and capacitors at their candidate sites. The reduction in RPL with DG and capacitors is evaluated using another analytical expression that relates power injections of DG and capacitors with RPL. An optimal power flow algorithm (OPF) is incorporated in the proposed method to consider the constraints of the distribution systems, DG, and capacitors. Various types of DG are considered, and their optimal power factors can be accurately computed while optimizing the sizes of capacitors in a simultaneous manner to reduce RPL. The 69-bus distribution system is used to test the proposed method. An exact search method is employed to verify the accuracy of the proposed method. The effectiveness of the proposed method is demonstrated for solving the optimal allocation problem with different combinations of multi-type DG units and capacitors.