  Let $R$ be a ring with identity $1$. Jacobson's lemma states that for any
$a,b\in R$, if $1-ab$ is invertible then so is $1-ba$. Jacobson's lemma has
suitable analogues for several types of generalized inverses, e.g., Drazin
inverse, generalized Drazin inverse, and inner inverse. In this note we give a
constructive way via Groebner-Shirshov basis theory to obtain the inverse of
$1-ab$ in terms of $(1-ba)^{-1}$, assuming the latter exists.
