I've just started studying this book. On page 5 of it, the following sentence has written:
Generally speaking, when using curvilinear (e.g. polar, cylindrical, spherical) coordinates $(y^1,...,y^n)$ for the Euclidean $\mathbb{R}^n$ we should expect the line elements to take the form of $$ds^2 = \sum_{ij}g_{ij}dy^idy^j$$
I want to know why our expectations should be in this form? What is the intuition behind it?
In physics (and math), we have the idea that the distance is given by
$$\begin{align} &\text{d}s = \| \vec{v} \|\text{d}t\\\\\implies &\text{d}s^2 = \| \vec{v} \|^2\text{d}t^2 \text{ .}\end{align}$$
The length of the velocity is measured by the dot product thus
$$ \begin{align} &\text{d}s^2 = \vec{v}\cdot\vec{v}\: \:\text{d}t^2 \\\\\implies &\text{d}s^2= (v^i \mathbf{e}_i)\cdot(v^j \mathbf{e}_j) \: \text{d}t^2 \\\\\implies &\text{d}s^2 = (\mathbf{e}_i\cdot\mathbf{e}_j)v^i\:v^j \text{d}t^2 \\\\\implies &\text{d}s^2 = g_{ij}v^iv^j \: \text{d}t^2 \text{ .}\end{align}$$
Lastly, all we have to say is that for each coordinate we have that
$$ \text{d}y^k = v^k \: \text{d}t $$
therefore
$$ \text{d}s^2 = g_{ij}\: \text{d}y^i\text{d}y^j \text{ .} $$