Effective computation of radical of ideals and its application to invariant theory