I'm reading the book "Einstein Gravity in a nutshell" by Anothy Zee and I'm a bit stuck on one of the steps in the derivation for divergence in an arbitrary coordinate system. The proof goes as follows,
since we know $$W^\mu\partial_\mu\phi$$ where $W^\mu$ is a vector field, $\phi$ is a scalar field, and $\partial_\mu=\frac{\partial}{\partial x^\mu}$ and $$\int\sqrt{g}d^Dx$$ where $g$ is the determinant of the metric $g_{\mu\nu}$, and $d^Dx$ is the integral in D dimensions (e.g. $d^3x=dx^1dx^2dx^3$), transform like scalars. We invoke the integral $$I=\int W^\mu\partial_\mu\phi\cdot\sqrt{g}d^Dx$$ which transforms like a scalar. Integrating by parts, $$I=W^\mu\phi\sqrt{g}-\int\phi\cdot\partial_\mu\left(W^\mu\sqrt{g}\right)d^Dx$$ However the book does not have the first term. Why is $W^\mu\phi\sqrt{g}=0$?
One possible explanation that I have come up with is that it transforms like a vector, so in order for the LHS and RHS to be consistent (i.e. transform like a scalar), the first term can only equal zero, but I think this is really pushing it. What's a better explanation?