We study the second variation of the lambda-invariant introduced by Zhang on
the complex moduli space of curves of genus g. As a result we prove that
(8g+4)\lambda is equal, up to a constant, to the invariant \beta introduced
some years ago by Hain and Reed. The \lambda-invariant measures the difference,
at archimedean places, between the height of the canonical Gross-Schoen cycle
and the Faltings stable height of a curve over a number field.
Let X be a smooth projective curve over a number field K given by an affine
equation y^N=f(x) for some integer N>1 and for some monic and separable
polynomial f(x) over K of degree larger than N and relative prime to N. We
prove that the canonical height on the image of X in its jacobian can be
written as a sum, over all places of K, of local integrals over X. We also
prove that, except for possibly finitely many exceptions, these local integrals
can be obtained by averaging over the n-division points of X.