We introduce a new method for computing heat invariants an(x) of a 2-dimensional Riemannian manifold based on a commutator formula derived by S. Agmon and Y. Kannai. Two explicit expressions for an(x) are presented. The first one depends on the choice of a certain coordinate system; the second involves only invariant terms but has some restrictions on its validity, though in a ‘generic’ case it is well-defined.