On first integrals of linear systems, Frobenius integrability theorem and linear representations of Lie algebras