# Method of Undetermined Coefficients

So the question asks me to use a method of undetermined coefficients to compute $a_1,a_2$ and $a_3$ such that

$Df(x,h) = a_1f(x+h)+a_2f(x+2h)+a_3f(x+4h)$

is a second order accurate approximation for $f'(x)$ but I don't know how to use undetermined coefficients to achieve this ?

• $f$ has arity two on the left hand side of the equation and arity one on the right hand side? – orlp May 31 '17 at 8:56
• I am not sure what you mean, the notation (in this case) $Df(x,y)$ means that $Df(x,y) \approx f'(x)$ ie $Df(x,h)$ is the approximation – carbonoperator May 31 '17 at 9:03

## 1 Answer

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).$$