                % 4th Order DERIVATIVE APPROXIMATION

                
% This program might be found helpful to complete Hw 5, problem 3.

% We need to find constants a, b, c, d, e 
% so that the Taylor expansion is of the highest order for: 
%
%       f'(x_0) = af(x_0-2h) + bf(x_0-h) + cf(x_0) + df(x_0+h) + ef(x_0+2h)
%      
% Here, unknown x is a vector of unknowns:
% x = [a, b, c, d, e]'

A = [ 1 1 1 1 1; -2 -1 0 1 2; 4 1 0 1 4; -8 -1 0 1 8; 16 1 0 1 16 ]
b = [0 1 0 0 0]'
x = A\ b
