  For a complex polynomial $D(t)$ of even degree, one may define the continued
fraction of $\sqrt{D(t)}$. This was found relevant already by Abel in 1826, and
later by Chebyshev, concerning integration of (hyperelliptic) differentials;
they realized that, contrary to the classical case of square roots of positive
integers treated by Lagrange and Galois, we do not always have pre-periodicity
of the partial quotients. In this paper we shall prove that, however, a correct
analogue of Lagrange's theorem still exists in full generality: pre-periodicity
of the {\it degrees} of the partial quotients always holds. Apparently, this
fact was never noted before. This also yields a corresponding formula for the
degrees of the convergents, for which we shall prove new bounds which are
generally best possible (halving the known ones). We shall further study other
aspects of the continued fraction, like the growth of the heights of partial
quotients. Throughout, some striking phenomena appear, related to the geometry
of (generalized) Hyperelliptic Jacobians. Another conclusion central in this
paper concerns the poles of the convergents: there can be only finitely many
rational ones which occur infinitely many times. (This is crucial for
applications to a function field version of a question of McMullen.) Our
methods rely, among other things, on linking Pad\'e approximants and
convergents with divisor relations in generalized Jacobians; this shall allow
an application of a version for algebraic groups, proved in this paper, of the
Skolem-Mahler-Lech theorem.
