Second-order perturbation algebra of invariant operators