Math calculators

Numerical calculus

Derivative of f(x) at a point, definite integrals and roots of equations, with method and error estimate.

Inputs

Results

f(x)

0.20.40.60.81-0.2500.250.50.7511.25x

Methodology

Conventions

  • Functions of x are written like the scientific calculator's expressions, for example x^2 * sin(x). Angles are in radians.
  • The derivative uses Ridders' extrapolation of central differences; the integral uses adaptive Simpson's rule; the root uses Brent's method on a bracket where f changes sign.
  • Each result carries an error estimate. Numerical methods can fail on discontinuities and singularities.

References

  • Press, Teukolsky, Vetterling and Flannery, Numerical Recipes, 3rd ed. (2007), §5.7, §4.7 and §9.3
  • Brent, Algorithms for Minimization without Derivatives (1973)

Formulas

Central difference
f'(x) \approx \frac{f(x + h) - f(x - h)}{2h}
Simpson
\int_a^b f \approx \frac{b - a}{6}\left[f(a) + 4f\left(\tfrac{a + b}{2}\right) + f(b)\right]
Bracket
f(a) \cdot f(b) < 0