Overview
This solution is a simpler altervative to that of gIS. It makes use only of the standard functions of Mathematica non-commutative multiplication (NCM) and replacement. Due to the uncommon features of the NCM, some care must be taken with linear combinations
In the first part we study the expression $\frac{1}{1-D f}$, which requires the powers of $(f D)$.
The second part is then devoted to the more general expression of the OP.
Part 1
We use the standard operation NonCommutativeMultiply[] as d and f do not commute (we write d instead of D to comply with Mathematica rules).
The shift operator will be implemented as the following replacement
r = d ** f[u_] -> f[u + a] ** d;
Now we have for the first few powers (notice that we have to use ReplaceRepeated[])
(f[x] ** d) //. r
(* Out[1111]= f[x] ** d *)
(f[x] ** d) ** (f[x] ** d) //. r
(* Out[1112]= f[x] ** f[a + x] ** d ** d *)
(f[x] ** d) ** (f[x] ** d) ** (f[x] ** d) //. r
(* Out[1113]= f[x] ** f[a + x] ** f[2 a + x] ** d ** d ** d *)
So the shift operator does what it should do.
We can call the product where all d's are pushed through to the right "normal".
Hence we know how to generate the normal product of the powers of (f[x] d)
Now the general power can be generated as
p[n_] := NonCommutativeMultiply @@ Table[f[x] ** d, {n}]
and the normal product is given by
pn[n_] := p[n] //. r
pn[3]
(* Out[1114]= f[x] ** f[a + x] ** f[2 a + x] ** d ** d ** d *)
We can generate the normal product of any power of the form (f[x] d).
This completes the first part.
Part 2
The second part is not difficult. The only additional expression is the product g[x] d (f d)^n
For example (n=3)
q = g[x] ** d ** pn[3] //. r
(* Out[1138]= g[x] ** f[a + x] ** f[2 a + x] ** f[3 a + x] ** d ** d ** d ** d *)
To finalize all expressions we use this second replacement
rf = {d -> 1, NonCommutativeMultiply -> Times};
For example
q //. rf
(* Out[1139]= f[a + x] f[2 a + x] f[3 a + x] g[x] *)
or
q1 = pn[2] + pn[3]
(* Out[1140]= f[x] ** f[a + x] ** d ** d + f[x] ** f[a + x] ** f[2 a + x] ** d ** d ** d *)
q1 /. rf
(* Out[1141]= f[x] f[a + x] + f[x] f[a + x] f[2 a + x] *)
Some care has still to be taken in linear combinations: we need to apply the function Distribute[] and have to take (-1) as an expression to appear as a factor of the NCM.
The complete expression including g is then (in "finalized" form)
gf[n_] := Distribute[(1 + (-1) ** g[x] ** d) ** pn[n]] //. r //. rf
Example
gf[3]
(* Out[1187]=
f[x] f[a + x] f[2 a + x] - f[a + x] f[2 a + x] f[3 a + x] g[x] *)
Discussion
1) The expression
$$\text{ff}=\frac{1}{1-D f}$$
can be written explicitly as
ff := 1 + Sum[Product[f[x + k a], {k, 0, n - 1}], {n, 1, \[Infinity]}]
$$\text{ff}\text{=}\sum _{n=1}^{\infty } \prod _{k=0}^{n-1} f(a k+x)+1$$
This expression can then be studied for further simplification depending on the function f.
2) In a comment, Jens pointed out that the term "shift operator" is reserved in standard literature as e.g. in quantum mechanics text books, and defined there as D f(x) = f(x+a) instead of D f(x) = f(x+a) D as in the OP.
Considering a typical expression of the OP, w = (D f)(D f), we see the difference
Standard use:
(D f)(D f) = f(x+a) D f = f(x+a) f(x+a) = f(x+a)^2
OP:
(D f)(D f) = f(x+a) D D f = f(x+a) D f(x+a) D = f(x+a) f(x+2a) D^2
I have adopted the understanding of the OP. In standard use the problem is trivial.
3) Example
Example
With
$$f(x)=x$$
the exponential operator gives
$$\text{fe}=\exp (f(x) d)=(1-a)^{-\frac{x}{a}}$$
$, but Mathematica code is prefered. – Feyre Oct 27 '16 at 09:02fcan be interpreted as an operator defined as multiplication-by-f. This form recalls the calculation one does in an undergraduate QM course to show that the commutator of position and momentum is non-zero. – march Oct 27 '16 at 16:04fa function andDan operator I think a clarification was needed, given the standard definition on Wikipedia and the absence of a coding example. – Jens Oct 27 '16 at 17:05