I like to think of it in the coordinate-free notation to remember how it works. If $\gamma(t)$ is your path, going from $t=a$ to $t=b$ (with velocity/tangent vector $\dot{\gamma}(t)$), and if $g$ is the metric then the length of the curve is
$$ \int_a^b \sqrt{g(\dot{\gamma}(t), \dot{\gamma}(t))} \; dt $$
If you want to compute it in different coordinates, just use the pull-back. That is, if $x = \varphi(y)$ changes from the $y$-coordinates to the $x$-coordinates, then the metric expressed in the $y$-coordinates is given by $\varphi^*g$. Then if you want to do this integral in the new coordinates, just make the appropriate substitutions.
In your polar coordinate example, you'd have $\varphi$ given by
$$ x = r\cos(\theta), ~~~ y = r\sin(\theta) $$
The usual Euclidean metric on the plane (in the "$x$"-coordinates) is
$$ g = dx \otimes dx + dy \otimes dy $$
Doing the pull-back $\varphi^*(g)$ gives
$$ \varphi^*g = dr \otimes dr + r^2 d\theta \otimes d\theta $$
So now if you write $\gamma(t)$ in polar coordinates as $\gamma(t) = (r(t), \theta(t))$, with $\dot{\gamma}(t) = (\dot{r}(t), \dot{\theta}(t))$, you get
$$ \int_a^b \sqrt{\dot{r}(t)^2 + r(t)^2 \dot{\theta}(t)^2} \; dt $$
As for your matrix formula: this is correct, and here is how it relates to the above. The metric is a "symmetric bilinear form" on the tangent spaces, and on a vector space, a symmetric bilinear form $\beta(\cdot, \cdot)$ is given by a symmetric $n$-by-$n$ matrix $B$ such that for any vectors $v$ and $w$, you have $\beta(v,w) = \left< v, Bw \right>$, where $\left< \cdot,\cdot \right>$ is the standard Euclidean dot product. In our case, the metric $g$ is represented in coordinates $(x_1,\dots,x_n)$ at every point by a matrix $G = \left(g_{ij}\right)_{i,j=1}^n$. Now suppose at the same point you look at a different system of coordinates $(y_1,\dots,y_n)$, as above, with transition map $\varphi$ going from the $y$-coordinates to the $x$-coordinates, with Jacobian matrix ("push-forward") $\varphi_*$, which is given by the matrix $S$ as in your post. Also, as in your notation, let $M = \left(M_{ij}\right)$ be matrix corresponding to the metric $g$ in the $y$-coordinates. Then your claim is that $M = S^T G S$ is how the metric changes when switching coordinates. This is because of the definition of how "pull-back" works, along with a property of the Euclidean dot product:
On the one hand, in the $y$-coordinates, if we have two vectors $v$ and $w$, then $g(v,w) = \left< v, M w \right>$. On the other hand, using the definition of the pull-back (remember the metric in $y$-coords is $\varphi^* g$, where $g$ is in the $x$-coords):
$$
\begin{eqnarray}
(\varphi^*g)(v,w) &=& g(\varphi_* v, \varphi_* w) \\
&=& \left< \varphi_* v, G \varphi_* w \right> \\
&=& \left< S v, GS w \right> \\
&=& \left< v, S^TGS w \right>
\end{eqnarray}
$$
Best Answer
There are two errors in this proof: