First integrals of local analytic differential systems