A left-invariant Riemannian metric on Lie group is a special case of homogeneous Riemannian manifold, and its differential geometry (geodesics and curvature) can be described in a quite compact form. I am most familiar with the description in 28.2 and 28.3 of here of covariant derivative and curvature.
But on a Lie group itself there is an explicit description of Jacobi fields available for
right invariant metrics (even on infinite dimensional Lie groups) in section 3 of:
- Peter W. Michor: Some Geometric Evolution Equations Arising as Geodesic Equations on Groups of Diffeomorphism, Including the Hamiltonian Approach. IN: Phase space analysis of Partial Differential Equations. Series: Progress in Non Linear Differential Equations and Their Applications, Vol. 69. Birkhauser Verlag 2006. Pages 133-215. (pdf).
I shall now describe the results (which go back to Milnor and Arnold). For detailed computations, see the paper.
Let $G$ be a Lie group with Lie algebra
$\def\g{\mathfrak g}\g$.
Let $\def\x{\times}\mu:G\x G\to G$ be the multiplication, let $\mu_x$ be left
translation and $\mu^y$ be right translation,
given by $\mu_x(y)=\mu^y(x)=xy=\mu(x,y)$.
Let $\langle \;,\;\rangle:\g\x\g\to\Bbb R$ be a positive
definite inner product. Then
$$\def\i{^{-1}}
G_x(\xi,\eta)=\langle T(\mu^{x\i})\cdot\xi,
T(\mu^{x\i})\cdot\eta)\rangle
$$
is a right invariant Riemannian metric on $G$, and any
right invariant Riemannian metric is of this form, for
some $\langle \;,\;\rangle$.
Let $g:[a,b]\to G$ be a smooth curve.
In terms of the right logarithmic derivative $u:[a,b]\to \g$ of $g:[a,b]\to G$, given by
$u(t):= T_{g(t)}(\mu^{g(t)\i}) g_t(t)$,
the geodesic equation has the expression
$$ \def\ad{\text{ad}}
\partial_t u = u_t = - \ad(u)^{\top}u\,,
$$
where $\ad(X)^{\top}:\g\to\g$ is the adjoint of $\ad(X)$ with respect to the inner product $\langle \;,\; \rangle$ on $\g$, i.e.,
$\langle \ad(X)^\top Y,Z\rangle = \langle Y, [X,Z]\rangle$.
A curve $y:[a,b]\to \g$ is the right trivialized version of a Jacobi field along the geodesic $g(t)$ described by $u(t)$ as above iff
$$
y_{tt}= [\ad(y)^\top+\ad(y),\ad(u)^\top]u
- \ad(u)^\top y_t -\ad(y_t)^\top u + \ad(u)y_t\,.
$$
Continued:
For connected $G$, the right invariant metric is biinvariant iff $\ad(X)^\top = -\ad(X)$.
Then the geodesic equation and the Jacobi equation reduces to
$$
u_t = \ad(u)u = 0,\qquad y_{tt} = \ad(u)y_t
$$
Now we can look at examples.
If $G=SU(2)$ then $\g=\mathfrak{sl}(3,\mathbb R)$ and we can take an arbitrary inner product on it.
(Maybe, I will continue if I have more time in the next few days).
Let $\nabla$ be the connection induced by the Levi-Civita connection. $\nabla$ is left invariant. It thus defines a bilinear product $b$ on ${\cal G}$ the Lie algebra of $G$. Let $c(t)$ be a geodesic. We can write $\dot c(t)=dL_{c(t)}(x(t))$ where $x(t)\in {\cal G}$. It you write the equation $\nabla_{\dot c(t)}\dot c(t)=0$, you obtain
$\dot x(t)+b(x(t),x(t))=0$.
Best Answer
The OP specifically asked for a(n ordinary) metric, not a Riemannian metric. While Misha and Paul have given good answers, I think that it's worth pointing out that, if one just takes an arbitrary left-invariant Riemannian metric $ds^2$ on a connected group $G$, there is no guarantee that the associated $dist$ can be computed explicitly. To do this, one would need to be able to integrate the geodesic equations explicitly enough to be able to construct the distance function; unless the Riemannian metric is quite special, this generally can't be done in any explicit way. (See for example, what one has to do to describe the free rotations of a rigid body that has 3 distinct moments of inertia, which is essentially computing the geodesics on $\text{SO}(3)$ with respect to a left-invariant metric that is not bi-invariant.)
An $\text{SL}(n,\mathbb{R})$-invariant metric on $\text{SL}(n,\mathbb{R})/\text{SO}(n)$: Since $M=\text{SL}(n,\mathbb{R})/\text{SO}(n)$ is an irreducible Riemannian symmetric space (with nonpositive sectional curvature), it has, up to constant multiples, only one $\text{SL}(n,\mathbb{R})$-invariant Riemannian metric, and the associated $dist$ in this case is not entirely trivial to write down: We can identify each element $m = A\cdot \text{SO}(n)$ with its associated positive definite, unimodular symmetric matrix $s = \sigma(m) = AA^T$, and the formula for $dist(s_1,s_2)$ is as follows: Write $$ \text{det}(ts_1-s_2) = (t-\lambda_1)(t-\lambda_2)\cdots(t-\lambda_n) $$ where each $\lambda_i$ is positive and they satisfy $\lambda_1\lambda_2\cdots\lambda_n=1$. Then, up to a constant multiple, one has $$ dist(s_1,s_2) = \left(\sum_{i=1}^n (\log\lambda_i)^2\right)^{1/2}. $$ Obviously, writing this out as a function of the entries of $s_1$ and $s_2$ would not be easy. (Of course, this is just one example of the sort of metric that Paul gave; its distinguishing characteristic is that it is the $dist$ of a Riemannian metric, which is not true for Paul's specific example.)
A left-invariant metric on $\text{SL}(n,\mathbb{R})$: Once an invariant metric on $M$ has been defined, one can use it to define a metric on $\text{SL}(n,\mathbb{R})$ itself: First, suppose that $n$ is odd, so that $\text{SL}(n,\mathbb{R})$ acts effectively on $M$. Let $\delta:M\times M\to \mathbb{R}$ be an invariant metric and let $(s_1,\ldots,s_k)\in M\times M\times \cdots \times M$ ($k$ times) be a $k$-tuple of symmetric matrices with the property that the simultaneous stabilizer of all of the $s_i$ in $\text{SL}(n,\mathbb{R})$ is the identity matrix. (I guess $k=3$ suffices to find such a $k$-tuple; $k=2$ does not.) Set $$ dist(A,B) = \delta(As_1,Bs_1) + \delta(As_2,Bs_2) + \cdots + \delta(As_k,Bs_k). $$ This defines a left-invariant metric on $\text{SL}(n,\mathbb{R})$. Note, however, that this is not derived from a Riemannian metric. When $n$ is even, $-I_n$ lies in $\text{SL}(n,\mathbb{R})$ and it acts trivially on $M$, so the above construction won't work. However, when $n$ is even, just take the metric induced on $\text{SL}(n,\mathbb{R})$ by its natural embedding into $\text{SL}(n{+}1,\mathbb{R})$, and that will do the job.
To get a Riemannian metric on $\text{SL}(n,\mathbb{R})$ whose $dist$ is computable, one should probably take the left-invariant metric $ds^2 = \text{tr}\bigl((g^{-1}dg)^Tg^{-1}dg\bigr)$. The reason is that this metric is both left-invariant and invariant under right action by $\text{SO}(n)$, and the extra symmetries make the geodesic flow explicitly integrable. (There is, of course, no bi-invariant Riemannian metric on $\text{SL}(n,\mathbb{R})$.)
A little calculation shows that the $ds^2$-geodesic starting at $I_n$ with velocity $v\in{\frak{sl}}(n,\mathbb{R})$ is given by the formula $$ \gamma_v(t) = e^{v^Tt}e^{(v-v^T)t}, $$ where $v^T$ represents the transpose of $v$. In particular, one has the 'formula', for $A\in\mathrm{SL}(n,\mathbb{R})$, $$ dist(I_n,A) = \min\bigl\{\bigl(\text{tr}(v^Tv)\bigr)^{1/2}\ |\ e^{v^T}e^{(v-v^T)} = A\bigr\}. $$ Unfortunately, computing this $dist$ more explicitly is a challenge. By left-invariance, of course, one has $dist(A,B) = dist(I_n,A^{-1}B)$, so this determines the metric completely.
Computing $dist$ explicitly is nontrivial even in the case $n=2$. In this case, one has the fortunate circumstance that, unless $\det(v)>0$, there are no conjugate points along the geodesic $\gamma_v$, and, when $\det(v)>0$, the first conjugate point is at $t = \pi/\sqrt{\det(v)}$. However, describing the exact cut locus of $I_n$ in ${\frak{sl}}(n,\mathbb{R})$ with respect to $ds^2$ does not seem to be trivial. This does not seem to be a particularly good way to construct a left-invariant metric on $\text{SL}(2,\mathbb{R})$. Nevertheless, it's not hopeless. If I have time, I'll add a little note to this describing what one can say.