One of the classic systems in dynamics and control is the inverted pendulum, which is known as one of the topics in control engineering due to its properties such as nonlinearity and inherent instability. Different approaches are available to facilitate and automate the design of fuzzy control rules and their associated membership functions. Recently, different approaches have been developed to find the optimal fuzzy rule base system using genetic algorithm. The purpose of the proposed method is to set fuzzy rules and their membership function and the length of the learning process based on the use of a genetic algorithm. The results of the proposed method show that applying the integration of a genetic algorithm along with Mamdani fuzzy system can provide a suitable fuzzy controller to solve the problem of inverse pendulum control. The proposed method shows higher equilibrium speed and equilibrium quality compared to static fuzzy controllers without optimization. Using a fuzzy system in a dynamic inverted pendulum environment has better results compared to definite systems, and in addition, the optimization of the control parameters increases the quality of this model even beyond the simple case.