Examining the slopes of Secants and Tangents for Calculus

Finding the rate of change of the function (how does y change as x changes). The red line is the Secant line between A and B. The green line is the tangent to the curve at the point A. The slopes of each line are shown. The position of the points A and B can be moved giving different secant lines and different tangents.

What happens when the point B comes closer to the point A? Note the slope of the Secant and the slope of the Tangent.