The present work is a mathematical analysis of two algorithms, namelythe Roothaan and the level-shifting algorithms, commonly used inpractice to solve the Hartree-Fock equations. The level-shiftingalgorithm is proved to be well-posed and to converge provided the shiftparameter is large enough. On the contrary, cases when the Roothaanalgorithm is not well defined or fails in converging areexhibited. These mathematical results are confronted to numericalexperiments performed by chemists.