numerical integration toolkit

an open-source visual calculator

function mapper


computations


error bounds

Compute errors (to 6 decimal places)

Midpoint Rule Error

$a =$, $b =$, $n =$

$|E_M| \le$

Trapezoidal Rule Error

$a =$, $b =$, $n =$

$|E_T| \le$


Note: Errors in this toolkit are guaranteed to be calculated accurately if $f(x)$ is at least three times differentiable on $[a, b]$, meaning all derivatives of $f(x)$ up to $f'''(x)$ should exist at all points across the interval $[a, b]$. As a rule of thumb, most functions that are continuously differentiable are generally smooth (i.e., no corners or cusps, no discontinuities, and no vertical tangents) across their whole domain.

Since we already have $a$, $b$, and $n$, we only need to solve for $K$. However, since most JavaScript plugins are unable to solve for exact maximum function values across an interval, we use a hybrid of two methods to numerically compute $\max_{x\in[a,b]} |f''(x)|$:

  1. Bisection method: This method is used in an algorithm to check the derivative of $|f''(x)|$ for sign changes along the interval $[a, b]$ by iterating through values with a set number of steps. If x at a previous step multiplied by x at the current step is less than or equal to 0, a sign change occured, and x is detected as an approximate root. If you're interested, more information can be found here.
  2. Newton's method: This method is used to refine the precision of each approximate root found. The algorithm analyzes the slope and curvature of local behaviour a certain number of times, each time getting closer and closer to the exact value of each root. If you're interested, more information can be found at here.

Interpreting the Midpoint Rule error bound

The error bound for the Midpoint Rule represents the maximum difference between the true integral and the midpoint rule approximation.

The formula for the error bound is the inequality $|{E_M}| \le \frac{K(b-a)^3}{24n^2}$, where $K$ is the maximum value of $|f''(x)|$ on the closed interval $[a, b]$.

Below are the steps followed to calculate the error bound, given $a =$ , $b = $ , and $n =$ .

Note: A second derivative of $0$ may mean the derivative is unable to be computed.

  1. Find the second derivative $f''(x)$, which is .
  2. Calculate $K$, which is $\max_{x\in[a,b]} |f''(x)|$.
  3. Plug in the values $K$, $b$, $a$, and $n$ into the expression $\frac{K(b-a)^3}{24n^2}$.

The expression $\frac{K(b-a)^3}{24n^2}$ provides the guaranteed upper bound of the approximation's error; that is, the absolute error $|{E_M}|$ is at most $\frac{K(b-a)^3}{24n^2}$.

Interpreting the Trapezoidal Rule error bound

The error bound for the Trapezoidal Rule represents the maximum difference between the true integral and the trapezoidal rule approximation.

The formula for the error bound is the inequality $|{E_T}| \le \frac{K(b-a)^3}{12n^2}$, where $K$ is the maximum value of $|f''(x)|$ on the closed interval $[a, b]$.

Below are the steps followed to calculate the error bound, given $a =$ , $b = $ , and $n =$ .

Note: A second derivative of $0$ may mean the derivative is unable to be computed.

  1. Find the second derivative $f''(x)$, which is .
  2. Calculate $K$, which is $\max_{x\in[a,b]} |f''(x)|$.
  3. Plug in the values $K$, $b$, $a$, and $n$ into the expression $\frac{K(b-a)^3}{12n^2}$.

The expression $\frac{K(b-a)^3}{12n^2}$ provides the guaranteed upper bound of the approximation's error; that is, the absolute error $|{E_T}|$ is at most $\frac{K(b-a)^3}{12n^2}$.


questions and information

Graph and sum controls
Inputting values for intervals and f(x)
Current limitations and restrictions