Integrated photonic gadgets play a key function in lots of fields. The process of designing silicon optical devices mostly relies on experience to manually adjust the subtle parameters, which is laborious and ineffective. The proposed inverse design algorithms can simplify the design process of silicon optical devices, improve the design efficiency, and realize multifunctional compact devices. In this paper, two inverse design based methods are proposed to design terahertz band wavelength division multiplexer(WDM). One is based on topology optimization to design a 4-channel ultra-wideband WDM and the other employs a direct binary search technique to create a 3-channel ultra-wideband terahertz WDM, both of which have high transmission, low interference and high integration. Multifunctional photonics devices are predicted to be increasingly used in modern photonic integrated circuits due to these advantages.