How to integrate a tensor in curved spacetime? I've read "We can only define the integral of a scalar function.  The integral of a vector or tensor field is meaningless in curved spacetime" on many books and lectures on General Relativity (For example on this notes from NYU: https://cosmo.nyu.edu/yacine/teaching/GR_2018/lectures/integration.pdf) and I was wondering if there's a way around it. For example, let's say there is a geodesic $z^\mu(\tau)$ and we are integrating some bitensor $G_{\mu\nu}(z,z')$ to get some quantity $Q(x)$
\begin{equation}
Q\left(x\right)=\int_{-\infty}^{\infty}G_{\mu\nu}\left[x,z\left(\tau'\right)\right]G^{\mu\nu}\left[x,z\left(\tau'\right)\right]d\tau'
\end{equation}
Here we are integrating a scalar function (once the bitensor $G_{\mu\nu}$ gets contracted with $G^{\mu\nu}=g^{\mu\alpha}g^{\nu\beta}G_{\alpha\beta}$). Also, the resulting scalar $Q(x)$ is evaluated at a spacetime point $x^\mu$ which might or might not be on the geodesic $z^\mu(\tau)$. Now, we could also try to derive  $Q(x)$
\begin{equation}
\frac{\partial}{\partial x^{\rho}}Q\left(x\right)=\\=\frac{\partial}{\partial x^{\rho}}\int_{-\infty}^{\infty}G_{\mu\nu}\left[x,z\left(\tau'\right)\right]G^{\mu\nu}\left[x,z\left(\tau'\right)\right]d\tau'\end{equation}
This is also a well-defined object, we are integrating a scalar over the worldline and then deriving. Now, what happens if we take the derivative inside the integral?
\begin{equation}
\frac{\partial}{\partial x^{\rho}}Q\left(x\right)=\int_{-\infty}^{\infty}\frac{\partial}{\partial x^{\rho}}\left\{ G_{\mu\nu}\left[x,z\left(\tau'\right)\right]G^{\mu\nu}\left[x,z\left(\tau'\right)\right]\right\} d\tau'
\end{equation}
Now the right hand side is the integral of a tensor with one free index $\rho$. But we had said that $\frac{\partial }{\partial x^\rho}Q(x)$ is well defined. So is integrating over a tensor also ill-defined in this case? Or could we procede without thinking too much about it?
Note: The bitensor $G_{\mu\nu}$ here is not important, it's just an example to show what my question is. If you like think of it as a Green's function.
 A: In this example, you are not integrating a vector field over curved spacetime. You are integrating over a family of vectors that all "belong" to the same point in spacetime. That's why the integral works.
Let's take a step back, and first notice that we can simplify your (bi)tensor field down to a scalar field without changing the question: letting $G[x,x']=G_{\mu\nu}[x,x']G^{\mu\nu}[x,x'],Q[x]=\int_{-\infty}^\infty G[x,z^\mu(\tau)]\,d\tau,\partial_\mu=\frac{\partial}{\partial x^\mu},$ what is the meaning of $\partial_\mu Q[x]=\int_{-\infty}^\infty\partial_\mu G[x,z^\nu(\tau)]\,d\tau$ ? We should inspect what $\partial_\mu$ actually does. If you call our spacetime manifold $M$, the operator $\partial_\mu$ takes a scalar field (like our $Q:M\to\mathbb{R}$) and a point $x\in M$ and produces a vector $\partial_\mu Q[x]\in {T\!M}_x,$ where ${T\!M}_x$ denotes the tangent space of $M$ at $x.$ If you evaluate $\partial_\mu Q[p],\partial_\mu Q[q]$ at two different points $p\neq q\in M,$ then these vectors will live in different vector spaces ${T\!M}_p,{T\!M}_q,$ and there will not be a canonical way to add them up. That is why you've been told you can't integrate vector/tensor fields over curved spacetime.
But the thing is that your integral does not evaluate such a vector field at different points. On the LHS, we have $\partial_\mu Q$ evaluated at $x$, which produces a vector that lives in ${T\!M}_x$. On the RHS, we have $\partial_\mu G[x,z^\nu(\tau)].$ Where's the scalar field, and at which point is the derivative being evaluated? Well, since we're only taking the derivative with respect to $x$, the scalar field is actually $G[x,z^\nu(\tau)],$ considered only as a function of $x$ (certain mathematicians might denote it $G[-,z^\nu(\tau)]$, with a "gap"), and the derivative of this field is being evaluated only at $x$. Therefore, for all the $\tau$, the integrand in fact is a vector in ${T\!M}_x,$ and so the integral is well defined because you aren't actually integrating vectors "from" different points in curved spacetime. (Or, in other words, if you're considering how a field $G[x,z^\nu(\tau)]$ varies for changes in $x$ while holding $z^\nu(\tau)$ constant, the vector $\partial_\mu G[x,z^\nu(\tau)]$ representing that variation should be "anchored" at only $x,$ and if you vary $\tau$ you can get a family of such vectors which you can then add up.)
A: What you are forgetting is if one asks about integration it means summing over infinitesimal objects of the same kind. Like think about it as integrating a vector field in flat spacetime, the vectors belong to the same vector space like a scalar, as scalars belong to their groups because they are $(0,0)$ tensors, that is, they do not change under change of co-ordinates.
Consider curved space-time on the other hand. The scalars remain the same because of their properties. But what about a vector field in this space. The idea of Parallel transport and covariant deravitive tells that there cant be a constant vector field in this spacetime, often thought of manifolds. So how can you integrate in vectors belonging from different species. Same goes for tensor fields.
