Differentiation from first principles

Drag the slider h and see how the gradient of the chord approaches the tangent (in red). If you desire change the function and see if you can work out what the equivalent gradient function is.