# Least common multiple (LCM)

We normally learned this for real in primary school which is remember in the name of ค.ร.น. . For polynomial mathematic, Maple provides one function called ‘lcm’. To see how it work see the following example.

$2x^2-yx-y^2 = (x-y)(y+2x)$
$2x^2+3yx+y^2 = (y+x)(y+2x)$

In Maple you can say

f1:= 2*x^2-y*x-y^2:
f2:= 2*x^2+3*y*x+y^2:
factor(f1);
$(x-y)(y+2x)$
factor(f2);
$(y+x)(y+2x)$

to get the answer.

Find the LCM

f3:=lcm(f1,f2);
$(x-y)(2x^2+3yx+y^2)$

You can see that the second part is just  f2 and you can see now why f3 is the LCM.

In OrePolynomial case the thing is more difficult, since

$\dfrac{b}{a}\cdot\dfrac{d}{c} = \dfrac{\alpha_1d}{\beta_2a}$

In this case $\alpha_1 = LCM(b,c)/b$ and $\beta_2 = LCM(b,c)/c$. The Maple code is shown below.

with(OreTools):

SS:=SetOreRing(t,'defferential'):
f1:= [OrePoly(b),OrePoly(a)]:
f2:= [OrePoly(d),OrePoly(c)]:
beta := LCM['left'](f1[1],f2[2],SS);
beta2:= Quotient['right'](beta,f1[1],SS);
alpha1:= Quotient['right'](beta,f2[2],SS);
[Multiply(alpha1,f2[1],SS),Multiply(beta2,f1[2],SS)];

## 6 comments on “Least common multiple (LCM)”

1. Nice post. I was checking constantly this weblog and I’m impressed! Very helpful info particularly the final part 🙂 I handle such info a lot. I was seeking this certain information for a very lengthy time. Thank you and good luck.

2. My relatives always say that I am killing my time here at net, however I know I am getting know-how all the time by reading such nice content.

3. I do not know if it’s just me or if perhaps everybody else encountering issues with your blog. It seems like some of the written text within your content are running off the screen. Can someone else please provide feedback and let me know if this is happening to them too? This could be a issue with my web browser because I’ve had this happen before.
Appreciate it

4. Hello! I’ve been following your site for a long time now and finally got the bravery to go ahead and give you a shout out from Atascocita Texas! Just wanted to mention keep up the fantastic job!

5. Excellent post. I was checking constantly this blog and I’m impressed! Extremely helpful info specifically the last part 🙂 I care for such information a lot. I was looking for this certain information for a very long time. Thank you and best of luck.

6. Reminds me of the “street lit” debate.