TITLE: Bi-orderability of Baumslag-Solitar group $\langle a,b \mid a^{-1} b^m a = b^n\rangle$ and of $\langle a,b \mid a^{-1} b a^m = b^n\rangle$
QUESTION [12 upvotes]: We say that a group $(A, \cdot)$ is bi-orderable if there exists a total order $\preceq$ on $A$ such that $xz \prec yz$ and $zx \prec zy$ for all $x,y,z \in A$ with $x \prec y$.
Let $m,n$ be non-zero integers, and let ${\rm BS}(m,n)$ denote the Baumslag-Solitar group $\langle a, b \mid a^{-1} b^m a = b^n\rangle$. I was happily surprised to learn from Yves Cornulier (see here) that  ${\rm BS}(1,n)$ is bi-orderable for $n \ge 1$, which naturally leads to the following:


Q1. Is there a ``nice'' characterization of those pairs $(m,n)$ such that ${\rm BS}(m,n)$ is bi-orderable?


E.g., ${\rm BS}(m,n)$ is not bi-orderable if $mn < 0$ (wlog, say that $1 \prec b$. Then, $b^{-1} \prec 1$, with the result that $ 1 \prec a^{-1} b^m a$ and $b^n \prec 1$ for $m > 0$, and dually $a^{-1} b^m a \prec 1$ and $1 \prec b^n$ otherwise) or $m = n \ge 2$ (wlog, say that $ab \prec ba$. Then, $a^n b \prec a^{n-1} b a \prec \cdots \prec aba^{n-1} \prec ba^n$). But what about the other cases?
Update on Q1. The question has been completely answered: ${\rm BS}(m,n)$ is bi-orderable if and only if $mn > 0$ and $\min(|m|,|n|) = 1$. For details, see Yves' answer below.
On a related note, let ${\rm D}(m,n)$ be the two-generator one-relator group $\langle a, b\mid a^{-1} b a^m = b^n\rangle$. This is sort of a variant of ${\rm BS}(m,n)$, and, while different in many ways, I'd like to know if both have a similar behavior as for orderability (by the way, does ${\rm D}(m,n)$ have a conventional name, so that I can look for references by myself?). In particular:


Q2. Is there a ``nice'' characterization of those pairs $(m,n)$ such that ${\rm D}(m,n)$ is bi-orderable?


In fact, ${\rm BS}(1,n) = {\rm D}(1,n)$, so the above (and, especially, Yves' argument) proves that ${\rm D}(1,n)$ is bi-orderable if and only if $n \ge 1$. But what about the other cases? E.g., is ${\rm D}(n,n)$ bi-orderable for $n \ge 2$?
Here is a question similar to Q1 (with total orders replaced by partial ones).

REPLY [10 votes]: (After the discussion in the comments.) $BS(m,n)$ is bi-orderable iff $mn>0$ and $\min(|m|,|n|)=1$.
Since it was already mentioned that $mn<0$ implies $BS(m,n)$ not bi-orderable and that $BS(1,n)$ is bi-orderable for all $n\ge 2$, all remains is to check that $2\le m\le n$ implies $BS(m,n)=\langle t,x\mid tx^mt^{-1}=x^n\rangle$ is not bi-orderable.
Define $y=txt^{-1}$. Then $y^m=x^n$. So $x$ commutes with $y^m$. So (*) $x$ commutes with $y$. But this is not the case.
(*) in a biorderable group, as mentioned by Salvo, $[X,Y^m]=1$, $m\ge 1$ implies $[X,Y]=1$, because otherwise if $XY<YX$, $X^mY<X^{m-1}YX<\dots<YX^m$ and similarly $YX<XY$ implies $YX^m<X^mY$.