Abstract. We present some efficient algorithms based on the Legendre-Galerkin approximations for the direct solution of the second and fourth order elliptic equations. The key to the efficiency of our algorithms is to construct appropriate base functions, which lead to systems with sparse matrices for the discrete variational formulations. The complexities of the algorithms are a small multiple of N d+1 operations for a d dimensional domain with (N − 1) d unknowns, while the convergence rates of the algorithms are exponential for problems with smooth solutions. In addition, the algorithms can be effectively parallelized since the bottlenecks of the algorithms are matrix-matrix multiplications. 1. Introduction. This article is the first in a series for developing efficient spectral Galerkin algorithms for elliptic problems. The spectral method employs global polynomials as the trial functions for the discretization of partial differential equations. It provides very accurate approximations with a relatively small number of unknowns. Consequently it has gained increasing popularity in the last two decades, especially in the field of computational fluid dynamics (see [11], [8] and the references therein).The use of different test functions in a variational formulation leads to three most commonly used spectral schemes, namely, the Galerkin, tau and collocation versions. In the collocation method, we work in the physical space -a set of collocation points; while in the Galerkin and tau methods, we work in the spectral space -the coefficients of the polynomial series. The Galerkin and collocation methods usually lead to optimal error estimates; while the tau method, being a modification of the Galerkin method, leads to non symmetric variational formulations and only sub-optimal error estimates are available (see for instance [19] and [20]). Gottlieb and Orszag in their pioneer book [11] presented an efficient Chebyshev-tau method; on the other hand, they presented a basis for the Galerkin method which leads to full matrices and its application in practice is prohibited. It is surprising that virtually no effort has been made on constructing appropriate bases (other than the Lagrangian interpolant basis) for the spectral-Galerkin method. Consequently the tau method along with the collocation method (the later being more natural for problems with variable coefficients) have been the focus of a great number of research papers (see [8] and the reference therein), while the Galerkin method, being more authentic and more accurate than the tau method, has draw less attention. We should point out that the spectral element method, developed by Patera and his group, is in fact a spectral-Galerkin method (see the survey paper [13]). However, the spectral element method, in the case of a single domain, differs from the spectral-Galerkin method to be presented in this work in two aspects: (i) a Gaussian quadrature formula is used instead of exact integration;