You are correct you get
$\displaystyle \displaystyle \Delta x = \frac{3}{n}$
then
$\displaystyle \displaystyle x_i=a+i\Delta x = a+\frac{3i}{n}$
When $\displaystyle i=0$ you get $\displaystyle a$ and when $\displaystyle i=n$ you get $\displaystyle b$
So from you formula $\displaystyle a=...$ and $\displaystyle b=...$
and you f is correct $\displaystyle f(x)=x^9$