Integrals and the Trapezoidal Rule

Learn how to compute integrals of functions using the trapezoidal rule.

What are integrals?

Suppose the velocity of a car at any time xx is given by a function f(x)f(x) and we would like to find the distance traveled by it in a certain time frame. Recall that the distance traveled by the car is represented as the area under velocity-time graph. Because f(x)f(x) can be any complex function, we need integrals to compute the area under a graph.

The integral of a function abf(x)dx\int_a^b f(x)\cdot dx represents the area under the curve f(x)f(x) between the points aa and bb. For univariate functions, the integral represents the area under the curve, whereas, for multivariate functions, it represents the volume (3D space) and its generalization in higher dimensions. Mathematically, an integral is defined as follows:

Get hands-on with 1200+ tech skills courses.