Skip to content
Projects
These are the docs of the development version (the devel branch). See the docs of the latest release.

Grid

The equations of example_pkg.grid, declared on the code that implements them and checked by the tests.

midpoint_integral

functionsource

The integral of f on [start, stop] by the composite midpoint rule.

rule
∫abf(x) dx≈h∑i=0n−1f(xi+xi+12)\int_a^b f(x)\,dx \approx h \sum_{i=0}^{n-1} f\left(\frac{x_i + x_{i+1}}{2}\right)
error
∣E∣≤(b−a)h224max⁡[a,b]∣f′′∣\left|E\right| \le \frac{(b - a) h^2}{24} \max_{[a, b]} |f''|
Order
2
Assumes
  • f twice continuously differentiable on [a, b]
References
  • Süli and Mayers, An Introduction to Numerical Analysis (2003), section 7.2