When the four values you name are not defined "prima vista" the integral in question has to be considered as an improper integral to begin with. In this case $$\int_a^b f'(x)g(x)\ dx:=\lim_{\epsilon\to0+,\ \epsilon'\to0+}\int_{a+\epsilon}^{b-\epsilon'} f'(x)g(x)\ dx$$ by definition. Now apply partial integration to the integral $\int_{a+\epsilon}^{b-\epsilon'} f'(x)g(x)\ dx$ and then proceed to the limit, if it exists.