  Functionals of a stochastic process Y(t) model many physical time-extensive
observables, e.g. particle positions, local and occupation times or accumulated
mechanical work. When Y(t) is a normal diffusive process, their statistics are
obtained as the solution of the Feynman-Kac equation. This equation provides
the crucial link between the expected values of diffusion processes and the
solutions of deterministic second-order partial differential equations. When
Y(t) is an anomalous diffusive process, generalizations of the Feynman-Kac
equation that incorporate power-law or more general waiting time distributions
of the underlying random walk have recently been derived. A general
representation of such waiting times is provided in terms of a L\'evy process
whose Laplace exponent is related to the memory kernel appearing in the
generalized Feynman-Kac equation. The corresponding anomalous processes have
been shown to capture nonlinear mean square displacements exhibiting crossovers
between different scaling regimes, which have been observed in biological
systems like migrating cells or diffusing macromolecules in intracellular
environments. However, the case where both space- and time-dependent forces
drive the dynamics of the generalized anomalous process has not been solved
yet. Here, we present the missing derivation of the Feynman-Kac equation in
such general case by using the subordination technique. Furthermore, we discuss
its extension to functionals explicitly depending on time, which are relevant
for the stochastic thermodynamics of anomalous diffusive systems. Exact results
on the work fluctuations of a simple non-equilibrium model are obtained. In
this paper we also provide a pedagogical introduction to L\'evy processes,
semimartingales and their associated stochastic calculus, which underlie the
mathematical formulation of anomalous diffusion as a subordinated process.
