to the metric, even if the Codazzi equation is not satisfied. For that, we will define the Codazzi function on a surface associated to its induced metric $I$ and a real quadratic form $II$. This function will measure how far is the pair $(I,II)$ from satisfying the Codazzi equation.

We devote Section \[s4\] to the fundamental relation between the Codazzi equation and the existence of holomorphic quadratic differentials. Thus, given a Codazzi pair on a surface $\Sigma$, we find, under certain conditions, the existence of a new Codazzi pair on $\Sigma$ whose Hopf differential is holomorphic. This new pair will provide geometric information about the initial one.

We particularize this result to the study of Codazzi pairs of special Weingarten type, that is, pairs satisfying $H=f(H^2-K)$ for a certain function $f$. The corresponding problem for surfaces in $\r^3$ and $\h^3$ was studied by Bryant in [@Br]. We will also prove that every Codazzi pair on a surface $\Sigma$ satisfying $H=f(H^2-K)$ can be recovered in terms of a metric on $\Sigma$ and a holomorphic quadratic form.

Finally, in Section \[s5\], we give some applications of our abstract approach to surfaces in space forms. We begin by obtaining height estimates for a 