Anaerobic digestion (AD) is considered one of the most beneficial waste management methods. It is a process in which microorganisms break down organic matter to produce biogas, which can be used as a source of energy, and digestate, which can be used as a biofertilizer. Several by-products could inhibit the process such as volatile fatty acids, ammonia, and hydrogen. Therefore, monitoring and selection of key factors is a significant operation that contributes to the optimization of the AD process. The mathematical modeling of this process is crucial and has had significant effects for these purposes. It has been classified into two main types, mechanistic models and data-driven models. The purpose of this paper is to provide a comprehensive review of AD mathematical modeling, as well as to emphasize the critical role of trend optimization algorithms in AD mathematical modeling.