For the first derivative only N−1 terms survive the ratio because the g-terms that are not differentiated cancel with their corresponding ones in the denominator. Then,
1ΨC∂ΨC∂xk=k−1∑i=11gik∂gik∂xk+N∑i=k+11gki∂gki∂xk.An equivalent equation is obtained for the exponential form after replacing gij by exp(fij), yielding:
1ΨC∂ΨC∂xk=k−1∑i=1∂gik∂xk+N∑i=k+1∂gki∂xk,with both expressions scaling as O(N).