To solve the primary problems in genetic algorithms, such as slow convergence speed, poor local searching capability and easy prematurity, the immune mechanism is introduced into the genetic algorithm, and thus population diversity is maintained better, and the phenomena of premature convergence and oscillation are reduced. In order to compensate the defects of immune genetic algorithm, the Hénon chaotic map, which is introduced on the above basis, makes the generated initial population uniformly distributed in the solution space, eventually, the defect of data redundancy is reduced and the quality of evolution is improved. The proposed chaotic immune genetic algorithm is used to optimize the complex functions, and there is an analysis compared with the genetic algorithm and the immune genetic algorithm, the feasibility and effectiveness of the proposed algorithm are proved from the perspective of simulation experiments.