## The trapezoidal rule (aka trapezoid or trapezium rule) approximates the area under the graph of a function.

We can use the trapeziodal rule for approximating definite integral | ∫ | ^{b} | f(x)dx |

_{a } |

### Trapezium (British English) / Trapezoid (American English)

#### Area Formula For One Trapezoid (Trapezium)

Area (A) | = | perpendicular height (h) | × | (a + b) |

2 |

We will use the notation below to demonstrate the trapezoid rule:

A | = | h | (a + b) |

2 |

### Graph Of A Function

#### Enclosed Area

Consider to calculate the coloured area under the graph shown below. The area is enclosed by the x-axis, the ordinate `AD`

, the ordinate `BC`

and the curve `DC`

. We will divide the area in five segments and fill these segments with trapezoids of the same perpendicular height.

#### Fill With Trapezoids

To fill the area, turn a trapezoid by 90° and place it under the graph. Resize the parallel sides (`a`

and `b`

) to reach from the x-axis to the graph. Repeat to fill the required area.

#### Dimensions

Once the area is filled with trapezoids, we can identify the dimensions of our trapezoids. The parallel sides of the trapezoids represents `f(x`

, _{0})`f(x`

, _{1})`f(x`

, _{2})`f(x`

, _{3})`f(x`

and _{4})`f(x`

. The height of each trapezoid represents _{LAST})`Δx`

. See graph below.

#### Formula

##### Area Formula For Trapezoids

We remember the area formula notation as stated at the beginning:

A | = | h | (a + b) |

2 |

Now we apply it to the five trapezoids under our graph:

Trapezoid 1 (A_{1}) | = | Δx | [ f(x_{0}) + f(x_{1}) ] |

2 |

Trapezoid 2 (A_{2}) | = | Δx | [ f(x_{1}) + f(x_{2}) ] |

2 |

Trapezoid 3 (A_{3}) | = | Δx | [ f(x_{2}) + f(x_{3}) ] |

2 |

Trapezoid 4 (A_{4}) | = | Δx | [ f(x_{3}) + f(x_{4}) ] |

2 |

Trapezoid 5 (A_{5}) | = | Δx | [ f(x_{4}) + f(x_{LAST}) ] |

2 |

##### Sum Of All Trapezoids

Add all trapezoid areas to approximate the coloured area under the graph.

Area | ≈ | A_{1} + A_{2} + A_{3} + A_{4} + A_{5} |

Area | ≈ | Δx | [f(x_{0})+f(x_{1})] | + | Δx | [f(x_{1})+f(x_{2})] | + | Δx | [f(x_{2})+f(x_{3})] | + | Δx | [f(x_{3})+f(x_{4})] | + | Δx | [f(x_{4})+f(x_{LAST})] |

2 | 2 | 2 | 2 | 2 |

Simplify above formula:

Area | ≈ | Δx | [f(x_{0}) + 2f(x_{1}) + 2f(x_{2}) + 2f(x_{3}) + 2f(x_{4}) + f(x_{LAST})] |

2 |

Area | ≈ | Δx | [f(x_{0}) + f(x_{LAST}) + 2 × (f(x_{1}) + f(x_{2}) + f(x_{3}) + f(x_{4}))] |

2 |

Now we can generalize this formula to obtain the final trapezoidal rule.

#### Trapezoidal Rule

And finally the formulas for the trapezoidal rule. The count of trapezoids used equals `n`

. See also the alternative notation.

∫ | ^{b} | f(x)dx | ≈ | Δx | [f(x_{0}) + f(x_{n}) + 2(f(x_{1}) + f(x_{2}) + ... + f(x_{n}_{-1}))] | Δx | = | b − a | |

_{a } | 2 | n |

Alternative notation:

∫ | ^{b} | f(x)dx | ≈ | Δx | [y_{0} + y_{n} + 2(y_{1} + y_{2} + ... + y_{n}_{-1})] | Δx | = | b − a | |

_{a } | 2 | n |

#### Identifying Δx

`Δx`

determines the height of our trapezoids and can be calculated by dividing the range by the number of chosen trapezoids `n`

. The range can be calculated by subtracting the lower limit `a`

from the upper limit `b`

. The greater the number of trapezoids `n`

, the closer the approximation.

Δx | = | b − a |

n |