Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible in Mathematica to take the LCM of an algebraic expression? For example, I want to take the LCM of $9$, $9y$, $12y^2$ and $27y^4$.

If I type in

LCM [9, 9y, 12y^2, 27^4] 

it returns the same value. I'm running Mathematica version 9. Could you help me out?

share|improve this question
What answer do you expect to see from LCM[9,9y,12y^2,27^4]? – bill s Oct 18 '13 at 2:54
May be you want PolynomialLCM[9, 9 y, 12 y^2, 27^4] which gives 2125764 y^2 – Nasser Oct 18 '13 at 3:04
There appears to be a typographical error cf LatTex list and code:` PolynomialLCM[9, 9 y, 12 y^2, 27y^4]` yields 108y^4 – ubpdqn Oct 18 '13 at 13:35
@Nasser You coould post this as a response. That way the question won't end up with 0 responses. – Daniel Lichtblau Oct 19 '13 at 21:28

To get the least common multiple of the polynomials, use PolynomialLCM.

From Mathematica help on the above it says by default treat algebraic numbers that appear in poly_i the as independent variables

Hence the answer you want is

PolynomialLCM[9, 9 y, 12 y^2, 27^4]

Mathematica graphics

More information on PolynomialLCM and more examples are here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.