How do you know you got a wrong result?
This question appears nearly identical to your last question but the the truncation (according to your code) being between 1/b and 1/a although your text (as with the previous question) gives the interval being between a and b.