g(x)=\frac{1}{2}(b-a)x+\frac{1}{2}(b+a)