Trace formulae and spectral inequalities for a class of differential operators