Solid-harmonic derivatives of quantum-mechanical integrals over Gaussian transforms of scalar, or radial, atomic basis functions create angular momentum about each center. Generalized Gaunt coefficients limit the amount of cross differentiation for multi-center integrals to ensure that cross differentiation does not affect the total angular momentum. The generalized Gaunt coefficients satisfy a number of other selection rules, which are exploited in a new computer code for computing forces in analytic density-functional theory based on robust and variational fitting of the Kohn–Sham potential. Two-center exponents are defined for four or more solid-harmonic differentiations of matrix elements. Those differentiations can either build up angular momentum about the centers or give forces on molecular potential-energy surfaces, thus generalized Gaunt coefficients of order greater than the number of centers are considered. These 4- j generalized Gaunt coefficients and two-center exponents are used to compute the first derivatives of all integrals involving all the Gaussian exponents on a triplet of centers at once. First all angular factors are contracted with the corresponding part of the linear-combination-of-atomic-orbitals density matrix. This intermediate quantity is then reused for the nuclear attraction integral and the integrals corresponding to each basis function in the analytic fit of the Kohn–Sham potential in the muffin-tin-like, but analytic, Slater–Roothaan method that allows molecules to dissociate into atoms having any desired energy, including the experimental electronic energy. The energy is stationary in all respects and all forces precisely agree with a previous code in tests on small molecules. During geometry optimization of an icosahedral C 720 fullerene computing these angular factors and transforming them via the 4- j generalized Gaunt coefficient takes more than sixty percent of the total computer time. These same angular factors could be used in identical fashion with Gaussian transforms of Slater-type and numerical radial atomic orbitals.