Expand in a Taylor's series:
$$a_1f(x+h) = a_1f(x) + a_1h Df(x) + a_1\frac{h^2}{2} D^2 f(x) + \cdots$$ $$a_2f(x+2h) = a_2f(x) + 2a_2h Df(x) + 2a_2h^2 D^2 f(x) + \cdots$$ $$a_3f(x+4h) = a_3f(x) + 4a_3h Df(x) + 8a_3h^2 D^2 f(x) + \cdots$$
Then we need the coefficients on the zeroth derivative to vanish, the first derivative to equal 1, the second derivative to vanish, etc. $$a_1 + a_2 + a_3 = 0$$ $$a_1 + 2ha_2 + 4ha_3 = 1$$ $$\frac{a_1h^2}{2} + 2a_2h^2 + 8a_3h^2 = 0$$
Then you'll have $$a_1f(x+h) + a_2f(x+2h) + a_3f(x+4h) = Df(x) + {\cal O}(h^3).$$