Call Us 07766496223
Suppose we have a curve  
\[ \mathbf{r} = \mathbf{r} (u_1 , u_2 , u_3 )\]
.
Then
\[ d \mathbf{r} = \frac{\partial \mathbf{r}}{\partial u_1} du_1 + \frac{\partial \mathbf{r}}{\partial u_2} du_2 + \frac{\partial \mathbf{r}}{\partial u_3} du_3 \]

Hence
\[\begin{equation} \begin{aligned} d \mathbf{r} \cdot d \mathbf{r} &= (g_1 du_1 + g_2 du_2 + g_3 du_3) \cdot ( g_1 du_1 + g_2 du_2 + g_3 du_3) \\ &= g_1 g_1 du_1 du_1 +g_1 g_2 du_1 du_2 + g_1 g_3 du_1 du_3 + g_2 g_1 du_2 du_1 +g_2 g_2 du_2 du_2 + g_3 g_3 du_3 du_3 + \\ &+ g_3 g_1 du_1 du_3 +g_3 g_2 du_1 du_2 + g_3 g_3 du_1 du_3 \\ &= \sum_i \sum_j g_{ij} u_1 u_j \\ &=g_{ij} u^i u^j \end{aligned} \end{equation}\]

where  
\[g_{ij} = g_i g_j\]
  and the summation is understood by the pairing of raised and lowered indices.
We can write  
\[ds^2 =g_{ij} u^i u^j \]