On the nonexistence of rational first integrals for nonlinear systems and semiquasihomogeneous systems