I'm trying to understand how the divergence formula in curvilinear coordinates is derived, but unfortunately my textbook doesn't go into much detail. Here is what they show:
I was wondering if someone could answer a couple of questions for me?
Firstly, is the vector field assumed to be constant?
Secondly, how exactly do they get to the line (8.9)? I don't really understand it. Is it done using surface integrals or something simpler?
If someone can answer these questions for me I would really appreciate it!

The flux through the left face of the "curvi-cube" is approximately $(A_1h_2h_3dx^2dx^3)|_{(x^1,x^2,x^3)}$ (assuming $A_1$ doesn't change much along the surface spanned by $h_2dx^2, h_3dx^3$, or more specifically, that how $A_1$ changes over the surface doesn't change much from the left to the right face, so we may as well pick a corner to evaluate it), while the flux through the right face is $(A_1h_2h_3dx^2dx^3)|_{(x^1 + dx^1,x^2,x^3)}$. Thus the net flux out if the cube through those two faces is $$ (A_1h_2h_3dx^2dx^3)|_{(x^1 + dx^1,x^2,x^3)} - (A_1h_2h_3dx^2dx^3)|_{(x^1,x^2,x^3)} $$ Since $dx^2$ and $dx^3$ doesn't change between the two faces, we may factor them out. This gives the left-hand side.
As for the right-hand side, we multiply by $1 = \frac{dx^1}{dx^1}$, and note that $\frac{1}{dx^1}$ goes together with the bracket to form the definition of the partial derivative of $A_1h_2h_3$ with respect to $x^1$. The remaining factor $dx^1dx^2dx^3$ stays outside the derivative.