first method of numerical integration - trapezoidal