Let $(u_1,u_2,u_3)$ be an coordinates on $\mathbb{R^3}$ s.t there is parametrization as the following: $$\vec{r}\left(u_{1}, u_{2}, u_{3}\right)=x_{1}\left(u_{1}, u_{2}, u_{3}\right) \hat{i}+x_{2}\left(u_{1}, u_{2}, u_{3}\right) \hat{j}+x_{3}\left(u_{1}, u_{2}, u_{3}\right) \hat{k}, \quad\left(u_{1}, u_{2}, u_{3}\right) \in D$$
assume that $\vec{r} \in C^1$ and let $$\vec{r}_{u_{1}}=\frac{\partial \vec{r}}{\partial u_{1}}, \quad \vec{r}_{u_{2}}=\frac{\partial \vec{r}}{\partial u_{2}}, \quad \vec{r}_{u_{3}}=\frac{\partial \vec{r}}{\partial u_{3}}$$ define the basis $$B=\left\{\vec{r}_{u_{1}}, \vec{r}_{u_{2}}, \vec{r}_{u_{3}}\right\}$$ for $\mathbb{R^3}$ and Let $$\tilde{B}=\left\{\vec{f}_{u_{1}}, \vec{f}_{u_{2}}, \vec{f}_{u_{3}}\right\}$$ be the dual basis s.t $$\left\langle f_{u_{i}}, \vec{r}_{u_{j}}\right\rangle=\delta_{i j}$$
define the matrix $g$ s.t $$g_{i j}=\left\langle\vec{r}_{u_{i}}, \vec{r}_{u_{j}}\right\rangle$$
Let $$f: \mathbb{R^3} \rightarrow \mathbb{R}$$ and $f \in C^1$ assume that $f$ is the function of the coordinates$(u_1,u_2,u_3)$ s.t $$f\left(u_{1}, u_{2}, u_{3}\right)=f\left(\vec{r}\left(u_{1}, u_{2}, u_{3}\right)\right)$$ show that the grad of $f$ in $(u_1,u_2,u_3)$ coordinates is $$\vec{\nabla} f=\sum_{i=1}^{3}(\vec{\nabla} f)_{i} \vec{r}_{u_{i}}=\sum_{i=1}^{3} \sum_{i=1}^{3}\left(g^{-1}\right)_{i j} \frac{\partial f}{\partial u_{j}} \vec{r}_{u_{i}}$$
while $\left(g^{-1}\right)_{i j}$ is the entries of the inverse matrix $g$.
I understood so far that the matrix g is the multiply of $J^TJ$ but I am not sure how it can help me solve this problem