# Finding the metric tensor from a 2D line element

A 2D space has coordinates $$x^1$$ and $$x^2$$ with line element

$$\mathrm{d} l^{2}=\left(\mathrm{d} x^{1}\right)^{2}+\left(x^{1}\right)^{2}\left(\mathrm{~d} x^{2}\right)^{2}.$$

I'm looking to find the metric tensor and its dual metric. I understand the basics of summing over $$g_{ij}$$ for $$n=2$$ and using the Kronecker delta but the second non $$dx^1$$ term is tripping me up. I don't know how to use it in summing as its not a derivative.

Your question is a bit unclear but as I understand it you want to derive the metric tensor of this line element and its inverse. You have to remember that $$dl^2 = g_{i j}dx^i dx^j$$. So your metric is $$\text{diag}(1,(x^1)^2)$$. And so its inverse is $$\text{diag}(1,(x^1)^{-2})$$.
$$\begin{equation} dl^2=g_{i j}dx^i dx^j=g_{11}(dx^1)^2+2g_{12}dx^1 dx^2+g_{22}(dx^2)^2 \end{equation}$$
So one has $$g_{11}=1$$, $$g_{12}=0$$ and $$g_{22}=(x^1)^2$$. Since the metric is diagonal finding its inverse is straightforward : $$g^{11}=1$$, $$g^{12}=g^{21}=0$$ and $$g^{22}=(x^1)^{-2}$$