  In the context of $f(R,T)$ gravity and other modified theories of gravity,
the knowledge of the first order variation of the trace $T$ of the
energy-momentum tensor with respect to the metric is essential for an accurate
characterization of the gravitational field. In this paper, by considering a
paradigmatic example of a perfect fluid whose dynamics is described by a pure
k-essence matter Lagrangian in $f(R,T)=R+\mathcal F(T)$ gravity, we show that
the first order variation of the trace of the energy-momentum tensor cannot in
general be determined from the proper density, proper pressure and 4-velocity
of the fluid alone, and that the sound speed of the fluid can directly
influence the dynamics of gravity. We also confirm that the second variation of
the matter Lagrangian with respect to the metric should not in general be
neglected. These results can be particularly relevant for cosmological studies
of $f(R,T)$ gravity in which some of the material content of the Universe is
modeled as a perfect fluid.
