  Let $(A,\Delta)$ be a weak multiplier Hopf algebra. It is a pair of a
non-degenerate algebra $A$, with or without identity, and a coproduct $\Delta$
on $A$, satisfying certain properties. The main difference with multiplier Hopf
algebras is that now, the canonical maps $T_1$ and $T_2$ on $A\otimes A$,
defined by $$T_1(a\otimes b)=\Delta(a)(1\otimes b)
\qquad\quad\text{and}\qquad\quad T_2(c\otimes a)=(c\otimes 1)\Delta(a),$$ are
no longer assumed to be bijective. Also recall that a weak multiplier Hopf
algebra is called regular if its antipode is a bijective map from $A$ to
itself.
  In this paper, we introduce and study the notion of integrals on such regular
weak multiplier Hopf algebras. A left integral is a non-zero linear functional
on $A$ that is left invariant (in an appropriate sense). Similarly for a right
integral. For a regular weak multiplier Hopf algebra $(A,\Delta)$ with
(sufficiently many) integrals, we construct the dual $(\widehat
A,\widehat\Delta)$. It is again a regular weak multiplier Hopf algebra with
(sufficiently many) integrals. This duality extends the known duality of
finite-dimensional weak Hopf algebras to this more general case. It also
extends the duality of multiplier Hopf algebras with integrals, the so-called
algebraic quantum groups. For this reason, we will sometimes call a regular
weak multiplier Hopf algebra with enough integrals an algebraic quantum
groupoid.
  We discuss the relation of our work with the work on duality for algebraic
quantum groupoids by Timmermann.
  We also illustrate this duality with a particular example in a separate
paper. In this paper, we only mention the main definitions and results for this
example. However, we do consider the two natural weak multiplier Hopf algebras
associated with a groupoid in detail and show that they are dual to each other
in the sense of the above duality.
