ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 09 Apr 2013 23:03:15 +0200How to simplify expression with fractional exponents?https://ask.sagemath.org/question/10006/how-to-simplify-expression-with-fractional-exponents/Is there a way to have Sage recognize that e^(2/3) times e^(1/3) in the below will simplify to just the variable e. Is there a type that can handle this? Obviously using a PolynomialRing in the code below won't work.
R.<a,e> = PolynomialRing(QQ)
p1 = (a+e^(1/3))
p2 = e^(2/3)
p1*p2Tue, 09 Apr 2013 21:24:12 +0200https://ask.sagemath.org/question/10006/how-to-simplify-expression-with-fractional-exponents/Answer by kcrisman for <p>Is there a way to have Sage recognize that e^(2/3) times e^(1/3) in the below will simplify to just the variable e. Is there a type that can handle this? Obviously using a PolynomialRing in the code below won't work.</p>
<pre><code>R.<a,e> = PolynomialRing(QQ)
p1 = (a+e^(1/3))
p2 = e^(2/3)
p1*p2
</code></pre>
https://ask.sagemath.org/question/10006/how-to-simplify-expression-with-fractional-exponents/?answer=14765#post-id-14765Do you mean something like this?
sage: var('a,e')
(a, e)
sage: p1 = (a+e^(1/3))
sage: p2 = e^(2/3)
sage: p1*p2
(a + e^(1/3))*e^(2/3)
sage: expand(_)
a*e^(2/3) + e
Tue, 09 Apr 2013 21:55:07 +0200https://ask.sagemath.org/question/10006/how-to-simplify-expression-with-fractional-exponents/?answer=14765#post-id-14765Comment by kcrisman for <p>Do you mean something like this?</p>
<pre><code>sage: var('a,e')
(a, e)
sage: p1 = (a+e^(1/3))
sage: p2 = e^(2/3)
sage: p1*p2
(a + e^(1/3))*e^(2/3)
sage: expand(_)
a*e^(2/3) + e
</code></pre>
https://ask.sagemath.org/question/10006/how-to-simplify-expression-with-fractional-exponents/?comment=17920#post-id-17920In general, unless you intend to work specifically with polynomials in an abstract algebraic sense, just use these "symbolic variables".Tue, 09 Apr 2013 23:03:15 +0200https://ask.sagemath.org/question/10006/how-to-simplify-expression-with-fractional-exponents/?comment=17920#post-id-17920