use left hand end point method cos(x) from 0 to pi