Description
Approximate ∫ab f(x) dx using quadratic polynomials. Composite form: partition [a,b] into n (even) subintervals of width h=(b-a)/n. Formula: (h/3)[f(x₀) + 4Σf(xodd) + 2Σf(xeven) + f(xn)]. Exact for cubics. Error O(h⁴). More accurate than trapezoidal rule.
Source: Wikipedia
Algorithm Flowchart
graph TD
A1["f x, interval a b\nn subintervals even"]
B1["h = b-a / n\nx_i = a + i h"]
C1["Sum = f x0 + 4 sum f x_odd\n+ 2 sum f x_even + f xn"]
D1["Integral = h/3 times Sum"]
F1["Return approximate integral"]
A1 --> B1
B1 --> C1
C1 --> D1
D1 --> F1
classDef red fill:#ff6b6b,color:#fff,stroke:#c0392b
classDef yellow fill:#ffd43b,color:#000,stroke:#f59f00
classDef green fill:#51cf66,color:#fff,stroke:#40c057
classDef lightblue fill:#74c0fc,color:#fff,stroke:#4dabf7
classDef violet fill:#b197fc,color:#fff,stroke:#9775fa
classDef lavender fill:#e6e6fa,color:#333,stroke:#b19cd9
class A1 red
class B1 yellow
class C1,D1 green
class F1 violet
Color Scheme (GLMP 6-Color)
Red
Triggers & Inputs
Triggers & Inputs
Yellow
Structures & Objects
Structures & Objects
Green
Processing & Operations
Processing & Operations
Light Blue
Intermediates & States
Intermediates & States
Violet
Products & Outputs
Products & Outputs
Lavender
Decision diamonds
Decision diamonds
Process Statistics
- Nodes: 5
- Edges: 4
- OR gates: 0
- Loops: 0
- AND gates: 0
- Complexity: O(n) evaluations, error O(h⁴)
Keywords
- Simpson's rule
- numerical integration
- quadrature
- calculus