In this paper we prove algebraic generalizations of some results of C. J. K. Batty and A. B. Thaheem, concerned with the identity α + α−1 = β + β−1 where α and β are automorphisms of a C*-algebra. The main result asserts that if automorphisms α, β of a semiprime ring R satisfy α + α-1 = β + β−1 then there exist invariant ideals U1, U2 and U3 of R such that Ui ∩ Uj = 0, i ≠ j, U1 ⊕ U2 ⊕ U3 is an essential ideal, α = β on U1, α = β−1 on U2, and α2 = β2 = α−2 on U3. Furthermore, if the annihilator of any ideal in R is a direct summand (in particular, if R is a von Neumann algebra), then U1 ⊕ U2 ⊕ U3 = R.