Open newton cotes quadrature with midpoint derivative for integration of algebraic functions