  We provide sufficient conditions so that a homeomorphism of the real line or
of the circle admits an extension to a mapping of finite distortion in the
upper half-plane or the disk, respectively. Moreover, we can ensure that the
quasiconformal dilatation of the extension satisfies certain integrability
conditions, such as $p$-integrability or exponential integrability. Mappings
satisfying the latter integrability condition are also known as David
homeomorphisms. Our extension operator is the same as the one used by Beurling
and Ahlfors in their celebrated work. We prove an optimal bound for the
quasiconformal dilatation of the Beurling--Ahlfors extension of a homeomorphism
of the real line, in terms of its symmetric distortion function. More
specifically, the quasiconformal dilatation is bounded above by an average of
the symmetric distortion function and below by the symmetric distortion
function itself. As a consequence, the quasiconformal dilatation of the
Beurling--Ahlfors extension of a homeomorphism of the real line is
(sub)exponentially integrable, is $p$-integrable, or has a $BMO$ majorant if
and only if the symmetric distortion is (sub)exponentially integrable, is
$p$-integrable, or has a $BMO$ majorant, respectively. These theorems are all
new and reconcile several sufficient extension conditions that have been
established in the past.
