Bolza continues and describes GaussGauss's derivation of the following formula (iI didn't include the derivation):
$$K_gds - d\theta = Pdp + Qdq$$$$(*) K_gds - d\theta = Pdp + Qdq$$
where $ds$ is an element of length of a curve, $\theta$ is the angle between the positive p-direction and the tangent to the curve, and $P,Q$ are the following functions:
$$P = \frac{EF_p - \frac{1}{2}EE_q - \frac{1}{2}FE_p}{E\sqrt{EG-F^2}},Q = \frac{\frac{1}{2}EG_p - \frac{1}{2}FE_q}{E\sqrt{EG-F^2}} $$
(Taking a line integral of both sides of equation (*) along a closed loop and applying Green's theorem on the right side enables to write the right side in the form:$\int\int(\frac {\partial P}{\partial q}-\frac{\partial Q}{\partial p})dpdq$. Apparently the term $\frac{\partial P}{\partial q}-\frac{\partial Q}{\partial p}$ is none other than the Gaussian curvature $K$.)