Weight reduction of gearbox is an effective approach for electric vehicles to extend their driving range. However, weight reduction will also result in the reduction of stiffness, which introduces possible resonance problems. It will reduce the transmission efficiency, life of parts and passenger comfort. Therefore, this article brings up a new method, which optimizes the structure of transmission in electric vehicles by using finite element analysis software to build the electric vehicle transmission model. With the topology optimization, this method could achieve design requirements in strength, stiffness, and natural frequency simultaneously, as well as could avoid resonance and improve transmission efficiency. The weight of transmission housing has been reduced from 11.79 kg to 9.83 kg, a reduction of approximately 17 %. However, its fundamental frequency is increased by 27 %, with maximum stress decreased by 10 %. The goal of lightweight and strength improvement have been achieved.