# How is the derivative geometrically inverse of integral?

I know that derivative is the slope of the tangent line, and that integral is the area under the curve.

My question is that how these two distinct concepts are geometrically related? What is the relation between the slope of the tangent line and the area under the curve?

If these are inverse of each other, then there should be a relation between them, I believe.

On the left, you have a curve of the original function $f(x)$, and the approximate area under it, shaded as red rectangles. The curve of the integral $\int f(x)dx$ is obtained by "adding" the areas together (right figure, the $y$ coordinate measures the total area of the curve in the left figure). The derivative of the right curve is the slope (dashed lines across the rectangles), and obviously, the slope of a rectangle with unit width is exactly its height, and the height of the rectangle brings you back to the left figure and the value $f(x)$.