What is the best numerical method of approximation of the derivative?

1k Views Asked by At

If I want to compute an approximation of the derivative of a simple function like $\cos$ and I can choose between finite differences and the derivative of the polynomial interpolating some given points, what is the best method to do it?

EDIT: By the best method, I mean the method by which I can obtain the most precise approximation of the derivative.

1

There are 1 best solutions below

0
On

This is an uneasy topic, numerical differentiation is an ill-posed problem.

The finite difference methods of different orders have an error term proportional to a derivative of some order of the function, so that higher order are well suited for smoother functions.

An important factor is the choice of the step, because for too small steps, numerical errors become dominant and the computed derivative becomes meaningless.

Read the Wikipedia article on Numerical differentiation.

Even worse if the data values are inaccurate or noisy. In such a case, you combine with a lowpass filters, such as Savitzky–Golay filter (Wikipedia) .

"Best" depends on the function and how it is computed.