For g(x) = ∫ a to x f(t)dt, I would like to know why there is an x at the upper limit and why it not equal to b, what is the difference?
There's a very important difference- $\displaystyle \int_a^b f(t)dt$ is a number, a constant. $\displaystyle \int_a^x f(t) dt$ is a function of x.
For example if f(t)= 2t+ 1, then $\displaystyle \int_1^2 f(t)dt= \int_a^b 2t+ 1 dt= \left[ t^2+ t\right]_1^2= 2^2+ 2- 1^2- 1= 4$ while $\displaystyle \int_1^x f(t)dt= \left[ t^2+ t\right]_a^x= x^2+ x- 1^2- 1= x^2+ x- 2$.
More subtle is the difference between $\displaystyle \int_a^x f(t)dt$ and the $\displaystyle \int f(x)dx$, the "indefinite integral" or "anti-derivative". $\displaystyle \int 2x dx= x^2+ C$ where we need the constant C since $\displaystyle (x^2+ C)'= 2x$ for any C. The "a" in $\displaystyle \int_a^x f(t)dt$ determines the specific C: $\displaystyle \int_0^x 2t dt= x^2- 0^2= x^2$ while $\displaystyle \int_1^x 2t dt= x^2- 1^2= x^2- 1$.