differentiation to find equation of tangent to curve