Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
1  
What answer do you expect to see from LCM[9,9y,12y^2,27^4]? –  bill s Oct 18 '13 at 2:54
6  
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
1  
@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

1 Answer 1

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

http://reference.wolfram.com/mathematica/ref/PolynomialLCM.html

share|improve this answer

Your Answer

 
discard

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.