Abstract. We give a fast, exact algorithm for solving Dirichlet problems with polynomial boundary functions on quadratic surfaces in R n such as ellipsoids, elliptic cylinders, and paraboloids. To produce this algorithm, first we show that every polynomial in R n can be uniquely written as the sum of a harmonic function and a polynomial multiple of a quadratic function, thus extending a theorem of Ernst Fischer. We then use this decomposition to reduce the Dirichlet problem to a manageable system of linear equations. The algorithm requires differentiation of the boundary function, but no integration. We also show that the polynomial solution produced by our algorithm is the unique polynomial solution, even on unbounded domains such as elliptic cylinders and paraboloids.