A theorem of Jacobi and its generalization