The following example is taken form Relativity, Gravitation and Cosmology, Ta-Pei Cheng, 2nd edition, page 89.
Fig. 1
$ds^2=(dx^1, dx^2) \begin{pmatrix}g_{11} & g_{12} \\ g_{21} & g_{22}\end{pmatrix}\begin{pmatrix}dx^1\\ dx^2\end{pmatrix} \tag{1}$
Here are further examples of metric tensors for two dimensional surfaces, calculated by using the fact the any surface in the small can be approximated by a plane having Cartesian coordinates. We also take this occasion to discuss the possibility of using the metric tensor to determine whether a surface is curved or not. For a flat surface, we can find a set of coordinates so that the metric tensor is position-independent; this is not the case in a curved surface as $g_{ab} = \mathbf{e}_a\cdot\mathbf{e}_b$ in a curved space must change from point to point.
- A plane surface with Cartesian coordinates For the coordinates $(x^1,x^2)=(x,y)$, we have the infinitesimal length $ds^2 = dx^2 + dy^2$ Fig. 1(a). Comparing this to the general expression in (1), we see that the metric must be
$g_{ab} = \begin{pmatrix} 1 && 0 \\ 0 && 1 \end{pmatrix} \tag{2}$
which is of course position-independent. This is possible only if the space is not curved.
- A plane surface with polar coordinates For the coordinates $(x^1, x^2)=(r,\phi)$, we have the infinitesimal length $ds^2 = (dr)^2 + (rd\phi)^2$, Fig. 1(b), thus according to (1), a metric
$g_{ab}=\begin{pmatrix}1 & 0 \\ 0 & r^2\end{pmatrix} \tag{3}$
which is position dependent! But we can find a coordinate transformation $(x^1, x^2) \to (x'^1, x'^2)$ so that the metric in the new coordinates is position independent, $g_{ab}'=\delta_{ab}$. Of course, the new coordinates are just the Cartesian coordinates $(x'^1, x'^2)=(x,y)$:
$x = r\cos\phi, \quad y=r\sin\phi \tag{4}$
Now while the whole thing makes intuitively sense I fail to use the given transformation in 2. to transform (3) into a position independent metric.
What exactly would be the correct transformation of $ds^2 = (dr)^2 + (rd\phi)^2$?