In particular, if $\displaystyle x= r cos(\phi)$ and $\displaystyle y= r sin(\phi)$, then $\displaystyle dx= \frac{\partial x}{\partial r}dr+ \frac{\partial x}{\partial \phi}d\phi= cos(\phi)dr- r sin(\phi)\d\phi$. And if $\displaystyle y= r sin(\phi)$, then $\displaystyle dy= \frac{\partial y}{\partial x}dr+ \frac{\partial y}{\partial \phi}d\phi= sin(\phi)dr+ r cos(\phi)d\phi$.

Squaring those,

$\displaystyle dx^2= cos^2(\phi)dr^2- 2r^2sin(\phi)cos(\phi)drd\phi+ r^2sin^2(\phi)d\phi^2$ and

$\displaystyle dy^2= sin^2(\phi)dr^2+ 2r^2sin(\phi)cos(\phi)drd\phi+ r^2 cos^2(\phi)d\phi^2$

Adding, the "$\displaystyle drd\phi$" terms cancel while $\displaystyle sin^2(\phi)+ cos^2(\phi)= 1$ so that

$\displaystyle ds^2= dx^2+ dy^2= dr^2+ r^2 d\phi^2$