An analytic energy gradient method for second-order quasidegenerate perturbation theory with multiconfigurational self-consistent field reference functions (MC-QDPT) is presented. An expression for the energy gradients is derived using the Lagrange multiplier method. The gradients are calculated without solving coupled perturbed equations. Instead, it is necessary to solve eight sets of linear equations for the multipliers. Six of the eight equations reduces to simple partial differential forms which directly give the multipliers, and only the remaining two are large scale linear equations that need iterative procedure. The gradients are given as the product of the first derivative integrals and the effective densities that depends on the obtained multipliers and the parameters. The expression for the conventional quasidegenerate perturbation theory and numerical results for the methylene molecule are also presented.