Representations of the metric in a Riemannian manifold I'm studying Introduction to Smooth Manifolds by John M. Lee. The books defines a metric on a smooth manifold in the following way:
Let $M$ be a smooth manifold, a Riemannian metric on $M$ is a smooth symmetric covariant $2-$tensor field on $M$ that is positive definite at each point.
From this definition, I understand that a Riemannian metric is a function $g$, such that, at each point $p \in M$,
$$
g_p: T_{p}M \times T_{p}M \to  \mathbb{R}
$$
From what I understand, If $M$ is a smooth $n-$dimensional manifold and we give a point $p \in M$, and a smooth chart $(U,\varphi)$ that contains $p$, a tensor field can be written as a linear combination:
$$
g_{p} = \sum_{i=1}^{n}\sum_{j=1}^{n} g_{ij}(p) d\varphi^{i}|_{p}\otimes d\varphi^{j}|_{p}
$$
where $\{d\varphi_{1}|_{p}, \ldots, d\varphi_{n}|_{p}\}$ is the basis for the cotangent space $T_{p}^{*}M$ dual to the basis $\{\frac{\partial}{\partial \varphi_{1}}|_{p}, \ldots, \frac{\partial}{\partial \varphi_{n}}|_{p}\}$ asociated to the local coordinates of the chart $(U,\varphi)$, and the coefficients $g_{ij}(p)$ are smooth functions and the matrix $(g_{ij})$ that his functions form is symmetric, positive definite.
How do I find these coefficients?
I saw somewhere that at each point, $g_{ij}(p)$ can be calculated with the given metric as:
$$
g_{ij}(p) = g_{p} \left(\left. \frac{\partial}{\partial \varphi_{i}} \right|_{p} ,\left. \frac{\partial}{\partial \varphi_{j}} \right|_{p}\right)
$$
but I'm not sure if that's correct, since it seems recursive to me.

I have also seen that the metric can be represented in different ways, for example, I have seen the metric of the sphere of radius $R$ represented as:
$$ G(\theta,\phi) = 
\begin{bmatrix}
R^{2} & 0 \\
0 & R^{2}\sin^{2}(\phi)
\end{bmatrix}$$
and as the matrix:
$$G(x) =
\begin{bmatrix}
\frac{4R^{4}}{(R^{2} + \|x\|^2)^2} & 0 \\
0 & \frac{4R^{4}}{(R^{2} + \|x\|^2)^2}
\end{bmatrix}
$$
I don't understand why one of the matrix takes two inputs and the other takes a single one, or how, given two tangent vectors, am I supposed to get a real number out of the matrices.
 A: How is the definition of $g_{ij}(p)$ recursive? It says take the tensor field $g$ (which you're already assuming is given to you from the beginning), and your chart $(U,\phi)$, and carry out, for each $p\in U$, the evaluation $g_p\left(\frac{\partial}{\partial x_{\phi}^i}(p), \frac{\partial}{\partial x_{\phi}^j}(p)\right)$. Let us be more specific and temporarily write this as $g_{(\phi),ij}(p)$ to indicate the dependence on the chart. So, this now gives you a matrix-valued function $G_{(\phi)}:U\to M_{n\times n}(\Bbb{R})$, which assigns to each $p\in U$, the matrix whose $(i,j)$ entry is $g_{(\phi), ij}(p)$.
Now, it is a matter of choice whether one wishes to consider $G_{(\phi)}:U\to M_{n\times n}(\Bbb{R})$ or the very closely related function $G_{(\phi)}\circ \phi^{-1}:\phi[U]\to M_{n\times n}(\Bbb{R})$. But in differential geometry, once you get the hang of things, people stop paying attention to such details. This is what you have in your examples:

*

*the first is the matrix representation of $g$ with respect to spherical coordinate chart. Here, $(\theta,\phi)\in (0,2\pi)\times (0,\pi/2)$ probably.

*the second is, I'm assuming, the matrix representation of $g$ relative to the stereographic projection chart. Here, $x\in \Bbb{R}^2=\text{image of stereographic projection chart}$.

Once you have the matrix, you can undo this process to get a tensor field, $g$, on the set $U$.

If this is not familiar, you should first review linear algebra: let $V$ be an $n$-dimensional vector space over a field $\Bbb{F}$, and $B:V\times V\to\Bbb{F}$ a bilinear map. Recall how given a basis $\beta=\{v_1,\dots, v_n\}$ of $V$, you can construct an $n\times n$ matrix $[B]_{\beta}$, and conversely, how given an $n\times n$ matrix, you can construct a corresponding bilinear map. Said differently, prove that the mapping $B\mapsto [B]_{\beta}= (B(v_i,v_j))_{i,j=1}^n$ is an isomorphism of $\text{Hom}^2(V;\Bbb{F})$ onto $M_{n\times n}(\Bbb{F})$.
What's going on above in the Riemannian geometry case is that you're applying this idea at each point $p\in U$ of a chart domain, and using the chart-induced basis on the tangent space $T_pM$.
