The derivative (or slope) of f at a is defined as
Since f'(a) is defined as a limit, we immediately have one strategy for finding it:
As we pick smaller values of h, we look at the slopes we're getting for the secant lines, and see if the slopes look like they're approaching some limit. If so, we can use that limit as our estimate for f'(a).
Since we're talking about a limit here, we need to do this twice: once as h approaches 0 from the right, and once as h approaches 0 from the left, to make sure the one-sided limits agree.