Derivada Numérica (centrada)
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
diferenças centradas
About this calculator
The centered numerical derivative calculator estimates the instantaneous rate of change of a function at a specific point without requiring its analytical expression. It uses the centered differences formula: f'(x) ≈ (f(x+h) − f(x−h)) / (2h), where h is a small increment. This method is more accurate than forward or backward differences, as it considers symmetric points around x, reducing truncation error to O(h²).
To use the tool, enter the function f(x) in mathematical format (e.g., x^2, sin(x), exp(x)), the point x where you want the derivative, and a value for h (typically between 0.001 and 0.1). The calculation is performed numerically, making it useful when the analytical derivative is complex or impossible to obtain. It is common in physics, engineering, and economics for modeling rates of change from discrete data.
Important considerations: the choice of h directly affects accuracy. A very large h increases truncation error; a very small h may cause catastrophic cancellation errors due to finite computer precision. It is recommended to test different h values to verify result stability. Also, the function must be continuous and differentiable in the considered interval.
Frequently asked questions
What if the result is very sensitive to the value of h?
Test progressively smaller values of h (e.g., 0.1, 0.01, 0.001) and see if the result converges. If h is too small, numerical cancellation may occur; in that case, use double precision or an alternative method.
Does this calculator work for functions defined by a table of points?
Not directly. It expects a continuous expression. For discrete data, use interpolation or finite differences directly on the points.
What is the difference between centered and forward derivative?
Centered uses symmetric points (x+h and x−h), offering error order O(h²). Forward uses (x+h) and x, with error O(h). Centered is generally more accurate for the same h.
Can I use h = 0?
No. h must be a small positive number, as the formula requires division by h. With h=0, division by zero occurs.
Is the result exact for polynomial functions?
For polynomials of degree up to 2, the centered formula with any h gives the exact derivative (barring rounding errors). For higher degrees, truncation error exists.