  In boundary element methods (BEM) in $\mathbb{R}^3$, matrix elements and
right hand sides are typically computed via analytical or numerical quadrature
of the layer potential multiplied by some function over line, triangle and
tetrahedral volume elements. When the problem size gets large, the resulting
linear systems are often solved iteratively via Krylov subspace methods, with
fast multipole methods (FMM) used to accelerate the matrix vector products
needed. When FMM acceleration is used, most entries of the matrix never need be
computed explicitly - {\em they are only needed in terms of their contribution
to the multipole expansion coefficients.} We propose a new fast method -
\emph{Quadrature to Expansion (Q2X)} - for the analytical generation of the
multipole expansion coefficients produced by the integral expressions for
single and double layers on surface triangles; charge distributions over line
segments and over tetrahedra in the volume; so that the overall method is well
integrated into the FMM, with controlled error. The method is based on the
$O(1)$ per moment cost recursive computation of the moments. The method is
developed for boundary element methods involving the Laplace Green's function
in ${\mathbb R}^3$. The derived recursions are first compared against classical
quadrature algorithms, and then integrated into FMM accelerated boundary
element and vortex element methods. Numerical tests are presented and
discussed.
