In the framework of the Roothaan-Hartree-Fock atomic theory, the solution of a many-electron problem is considered on the basis of the methods of minimizing a function of many variables. To implement this approach, expressions are obtained for the energy derivatives with respect to the elements of density matrices and the nonlinear parameters of atomic orbitals, that is, orbital exponents. Using the first-and second-order minimization methods, we performed optimization of the orbital exponents of Slater-type atomic orbitals for atoms and ions with several open shells. For them, energies that are close to the data of the numerical solution of the Hartree-Fock equations at a high accuracy of the virial ratio were determined. For a number of atoms the frequencies of the first dipole transitions were calculated, and the results were compared to the data obtained in calculation by the method of random phases and to experimental data.Introduction. At the present time, there is quite a number of different methods in quantum physics to carry out calculations of the optical properties of atoms and molecules. Each of these methods has its special features and field of application. The demand for accurate theoretical data for atomic and molecular properties has stimulated application and further development of the theory, which consists of verification of the available methods and development of new, more effective ones. As before, the Hartree-Fock method and its algebraic variant -the Hartree-FockRoothaan method -remain sufficiently simple and accurate. However, in contemporary calculations relating to optimization of basis sets [1-4], minimization methods without computation of derivatives are usually used. These methods allow one to carry out optimization only with a limited accuracy and require enormous expenditures of computer time. In [5][6][7], with in the framework of the classical Roothaan method [8], a method is developed for solving the HartreeFock equations for many-electron systems with closed and open shells; the method is based on the contemporary methods of minimization of the functions of many variables. These methods involve proven conditions and a high rate of convergence and rigorous criteria for termination of the computation, which makes it possible to find a solution for a many-electron problem in the LCAO approximation (orbital coefficients and exponents of atomic orbitals) with any given accuracy. To realize the minimization algorithms of the first and second orders, expressions were obtained in the framework of the Hartree-Fock-Roothaan method for calculating the energy derivatives of the system with respect to optimized parameters [5,6] such as the elements of density matrices, which are constructed from orbital coefficients, and the exponents of atomic orbitals. In the present article, this approach is extended to the Roothaan-Hartree-Fock atomic theory [9, 10] (the Roothaan-Bagus method), which allows one to calculate atoms with several open shells. In the framework of this method we carried out...