Numerical differentiation

Central Difference Derivative Lab

Estimate first and second derivatives from values on both sides of a point.

Back to topic

Formula

f'(a) approx (f(a+h)-f(a-h))/(2h), f''(a) approx (f(a+h)-2f(a)+f(a-h))/h^2

Result

Worked substitution


          

Central differences cancel more error than one-sided differences, but tiny h can amplify rounding noise.

Read the result

The first derivative compares the two side values. The second derivative measures how far the centre value sits from their average.

Where it helps

Use it when you have measured or tabulated values rather than a clean formula.

Common slip

A smaller h is not always better; subtracting nearly equal rounded values can damage accuracy.

Try it

Halve all three x-spacings conceptually by changing h and see how strongly the estimates respond.