  Continuous-time random walk (CTRW) is a model of anomalous sub-diffusion in
which particles are immobilized for random times between successive jumps. A
power-law distribution of the waiting times, $\psi(\tau) \tau^{-(1+\alpha)}$,
leads to sub-diffusion ($<x^2>~t^{\alpha}$) for 0<\alpha<1. In closed systems,
the long stagnation periods cause time-averages to divert from the
corresponding ensemble averages, which is a manifestation of weak ergodicity
breaking. The time-average of a general observable $\bar{U} = \int_0^t
U[x(\tau)]d\tau / t$ is a functional of the path and is described by the well
known Feynman-Kac equation if the motion is Brownian. Here, we derive forward
and backward fractional Feynman-Kac equations for functionals of CTRW in a
binding potential. We use our equations to study two specific time-averages:
the fraction of time spent by a particle in half box, and the time-average of
the particle's position in a harmonic field. In both cases, we obtain the
probability density function of the time-averages for $t \rightarrow \infty$
and the first two moments. Our results show that both the occupation fraction
and the time-averaged position are random variables even for long-times, except
for \alpha=1 when they are identical to their ensemble averages. Using the
fractional Feynman-Kac equation, we also study the dynamics leading to weak
ergodicity breaking, namely the convergence of the fluctuations to their
asymptotic values.
