Generalized rational first integrals of analytic differential systems