I am trying to understand a proof in B. O'Neill's Semi-Riemanian Geometry. Specifically, I am trying to understand 12. Theorem which in my book is on page 8. The proof is to the theorem that the set $\{\partial_1, \ldots \partial_n \}$ forms a basis in $TpM$.
Let $\xi(\mathcal U)$ be a chart defined on an open set $\mathcal U$, and let $\xi(\mathcal U) = \{q \in \mathbb{R}^n : |q| < \epsilon \}$ for some $\epsilon > 0$. Let $g$ be a smooth function.
Suppose $0 \leq t \leq 1$.
My problem begins right at the start of the proof where he says to define $$g_i(q) := \int_0^1 \frac{\partial g}{\partial u^i}(tq) dt$$ Where did this function come from? What does it even mean? What is the reason for the $tq$ argument and not just $t$?
Then he states that using the Fundamental Theorem of Calculus, one can obtain: $$g = g(0) + \sum g_i u^i$$
And the proof goes on from there. I think I understand how to get the second equation using the Fundamental Theorem of Calculus, but I have no idea where that integral came from or what it means and that is where I need help. (I know I can just treat it as a definition, but it drives me crazy if I can't see where it came from and understand it.)
Note that $g:\xi(\mathscr U)\subset \Bbb R^n\to\Bbb R$ where $\xi(\mathscr U)=\{q\in\Bbb R^n:\lVert q\rVert<\varepsilon\}$. The Fundamental Theorem of Line Integrals states that $$ g(q)-g(0) =\int_0^1\nabla g\bigl(\mathbf{r}(t)\bigr)\cdot \mathbf r^\prime(t)\,dt\tag{1} $$ for any $q\in\xi(\mathscr U)$ where $\mathbf r(t)$ is any curve in $\xi(\mathscr U)$ with $\mathbf{r}(0)=0$ and $\mathbf{r}(1)=q$. Since $\xi(\mathscr U)$ is convex we can take $\mathbf{r}(t)=t\cdot q$. If $u^1,\dotsc,u^n:\Bbb R^n\to\Bbb R$ are the coordinate functions, then \begin{align*} \nabla g &= \left\langle \frac{\partial g}{\partial u^1},\dotsc,\frac{\partial g}{\partial u^n} \right\rangle & \mathbf{r}(t) &= \left\langle t\cdot u^1(q),\dotsc,t\cdot u^n(q) \right\rangle \end{align*} It follows that $$ \mathbf{r}^\prime(t)= \left\langle u^1(q),\dotsc,u^n(q) \right\rangle $$ Now (1) takes the form \begin{align*} g(q) &= g(0)+\int_0^1\nabla g\bigl(\mathbf{r}(t)\bigr)\cdot \mathbf r^\prime(t)\,dt \\ &= g(0)+\int_0^1 \left\langle \frac{\partial g}{\partial u^1}(t\cdot q),\dotsc,\frac{\partial g}{\partial u^n}(t\cdot q) \right\rangle\cdot \left\langle u^1(q),\dotsc,u^n(q) \right\rangle\,dt \\ &= g(0)+ \left\langle \int_0^1\frac{\partial g}{\partial u^1}(t\cdot q)\,dt,\dotsc,\int_0^1\frac{\partial g}{\partial u^n}(t\cdot q)\,dt \right\rangle\cdot \left\langle u^1(q),\dotsc,u^n(q) \right\rangle \\ &= g(0)+\bigl\langle g_1(q),\dotsc,g_n(q)\bigr\rangle\cdot\bigl\langle u^1(q),\dotsc,u^n(q) \bigr\rangle \\ &=g(0)+g_1(q)\cdot u^1(q)+\dotsb+g_n(q)\cdot u^n(q) \\ &=g(0)+\sum g_i(q)\cdot u^i(q) \end{align*} Hence $ g=g(0)+\sum g_i\cdot u^i $ as advertised.