$\operatorname{LMOpLCLM}({\mathit Lset}, x, M, b)$
libname := libname, FileTools:-JoinPath(["maple","lib","dcfun.mla"],base=homedir):
with(dcfun):
We define two simple linear Mahler operators.
b := 3:
$$$$
L1 := RamRatPolyToLMOp(1/(1 - 2*x), x, M , b);
$$2 x -1-\left(2 x^{3}-1\right) M$$
L2 := RamRatPolyToLMOp(1/(1 - 3*x), x, M , b);
$$-1+3 x -\left(3 x^{3}-1\right) M$$
LL := [L1, L2];
$$[2 x -1-\left(2 x^{3}-1\right) M, -1+3 x -\left(3 x^{3}-1\right) M]$$
We compute their lowest common left multiple.
L := LMOpLCLM(LL, x , M, b);
$$\left(6 x^{18}-5 x^{9}+1\right) M^{2}+\left(-6 x^{12}-6 x^{10}+5 x^{9}-6 x^{8}+5 x^{7}-7 x^{6}+5 x^{5}-x^{4}+5 x^{3}-x^{2}-1\right) M +6 x^{8}-5 x^{7}+7 x^{6}-5 x^{5}+7 x^{4}-5 x^{3}+x^{2}$$
Euclidean division confirms that we have a common multiple.
Q1, R1 := LMOpRightEuclideanDivision(L, L1, x, M, b);
$$\left(-3 x^{9}+1\right) M +3 x^{7}-x^{6}+3 x^{5}-x^{4}+3 x^{3}-x^{2}, 0$$
Q2, R2 := LMOpRightEuclideanDivision(L, L2, x, M, b);
$$\left(-2 x^{9}+1\right) M +2 x^{7}-x^{6}+2 x^{5}-x^{4}+2 x^{3}-x^{2}, 0$$
The Euclidean divisions provide us with the cofactors of each linear Mahler operator. It is possible to obtain them directly with a name as fifth argument given to $\operatorname{LMOpLCLM}$.
L := LMOpLCLM(LL, x, M, b, 'kof');
$$\left(6 x^{18}-5 x^{9}+1\right) M^{2}+\left(-6 x^{12}-6 x^{10}+5 x^{9}-6 x^{8}+5 x^{7}-7 x^{6}+5 x^{5}-x^{4}+5 x^{3}-x^{2}-1\right) M +6 x^{8}-5 x^{7}+7 x^{6}-5 x^{5}+7 x^{4}-5 x^{3}+x^{2}$$
Let us compare the obtained expressions.
kof;
$$[\left(-3 x^{9}+1\right) M +3 x^{7}-x^{6}+3 x^{5}-x^{4}+3 x^{3}-x^{2}, \left(-2 x^{9}+1\right) M +2 x^{7}-x^{6}+2 x^{5}-x^{4}+2 x^{3}-x^{2}]$$
Q1 := collect(Q1, M, factor);
$$\left(-3 x^{9}+1\right) M +x^{2} \left(-1+3 x \right) \left(x^{2}+x +1\right) \left(x^{2}-x +1\right)$$
Q2 := collect(Q2, M, factor);
$$\left(-2 x^{9}+1\right) M +x^{2} \left(2 x -1\right) \left(x^{2}+x +1\right) \left(x^{2}-x +1\right)$$
In order to impose uniqueness on the lowest common left multiple, we can impose that it be monic (wrt $M$).
LMOpLCLM(LL, x, M, b, 'kof', 'output' = 'monic');
$$M^{2}-\frac{\left(6 x^{12}+6 x^{10}-5 x^{9}+6 x^{8}-5 x^{7}+7 x^{6}-5 x^{5}+x^{4}-5 x^{3}+x^{2}+1\right) M}{6 x^{18}-5 x^{9}+1}+\frac{x^{2} \left(6 x^{6}-5 x^{5}+7 x^{4}-5 x^{3}+7 x^{2}-5 x +1\right)}{6 x^{18}-5 x^{9}+1}$$
kof;
$$\left[-\frac{M}{2 x^{9}-1}+\frac{x^{2} \left(3 x^{5}-x^{4}+3 x^{3}-x^{2}+3 x -1\right)}{6 x^{18}-5 x^{9}+1}, -\frac{M}{3 x^{9}-1}+\frac{x^{2} \left(2 x^{5}-x^{4}+2 x^{3}-x^{2}+2 x -1\right)}{6 x^{18}-5 x^{9}+1}\right]$$