You are asking about a particular case of the general right invariant Lagrangian for curves on a Lie group. This is a well-known story, but I can summarize it here:

Let $G$ be a Lie group with Lie algebra ${\frak{g}}=T_eG$ and dual ${\frak g}^\ast$, with the canonical pairing $\langle,\rangle:{\frak g}^\ast\times{\frak g} \to \mathbb{R}$. Let $\mathrm{ad}$ and $\mathrm{ad}^\ast$ be the adjoint and co-adjoint representations, respectively, so that, for example
$$
\langle \mathrm{ad}^\ast(x)\xi,y\rangle = -\langle\xi,\mathrm{ad}(x),y\rangle = -\langle\xi,[x,y]\rangle.
$$
(Some people often forget about this minus sign, which is why I am reminding you of it now.)

Now, let $F:{\frak g}\to\mathbb{R}$ be a function that is smooth away from $0\in{\frak g}$ and has the property that $L = F^2$ is strictly convex on $\frak g$. Then we want to know the geodesics of the right-invariant functional
$$
\lambda(\gamma) = \int_a^b F\bigl(\rho(\dot\gamma(t))\bigr)\ dt
$$
where $\gamma:[a,b]\to G$ is a differentiable curve and $\rho:TG\to{\frak g}$ is the canonical right-invariant $1$-form on $G$. Usually, to get a convex functional (and fix the parametrization), we instead consider the energy functional
$$
E(\gamma) = \int_a^b \bigl(F\bigl(\rho(\dot\gamma(t))\bigr)\bigr)^2\ dt
=\int_a^b L\bigl(\rho(\dot\gamma(t))\bigr)\ dt.
$$

Here is the standard formula: Let $L':{\frak g}\to {\frak g}^\ast$ be the *Legendre transform* of $L$, i.e., $d L = \langle L'(p), d p\rangle$.

Then a curve $\gamma:[a,b]\to G$
satisfies the Euler-Lagrange equations if and only if $p(t)=\rho\bigl(\dot\gamma(t)\bigr)$
satisfies the *Euler equation*
$$
\frac{d\ }{dt}\bigl(L'(p(t))\bigr)
= -\mathrm{ad}^\ast\bigl(p(t)\bigr)\bigl(L'(p(t))\bigr).
$$

You should have no difficulty specializing this to your case.