  We study the spectral functional tr f(D+A) for a suitable function f, a
self-adjoint operator D having compact resolvent, and a certain class of
bounded self-adjoint operators A. Such functionals were introduce by
Chamseddine and Connes in the context of noncommutative geometry. Motivated by
the physical applications of these functionals, we derive a Taylor expansion of
them in terms of G\^ateaux derivatives. This involves divided differences of f
evaluated on the spectrum of D, as well as the matrix coefficients of A in an
eigenbasis of D. This generalizes earlier results to infinite dimensions and to
any number of derivatives.
