We present a theoretical development of the equations required to perform an analytic geometry optimization of a molecular system using the XYG3 type of doubly hybrid (xDH) functionals. In contrast to the well-established B2PLYP type of DH functionals, the energy expressions in the xDH functionals are constructed by using density and orbital information from another standard Kohn–Sham (KS) functional (e.g., B3LYP) for doing the self-consistent field calculations. Thus, the xDH functionals are nonvariational in both the hybrid density functional part and the second-order perturbation part, each of which requires formally to solve a coupled-perturbed KS equation. An implementation is reported here which combines the two parts by defining a total Lagrangian such that only a single set of the Z-vector equations need to be solved. The computational cost with our implementation is of the same order as those for the conventional Møller–Plesset theory to the second order (MP2) and B2PLYP. Systematic test calculations are provided for covalently bonded molecules as well as compounds involving the intramolecular nonbonded interactions for the main group elements. Satisfactory performance of the xDH functionals demonstrates that the extra computer time on top of the conventional KS procedure is well-invested, in particular, when the standard KS functionals and MP2 as well, are problematic. © 2013 Wiley Periodicals, Inc.