ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 16 Feb 2019 08:15:17 -0600Wrong factorization of expressions containing exponentials ?http://ask.sagemath.org/question/45469/wrong-factorization-of-expressions-containing-exponentials/Is there something wrong with the factorization of expressions containing exponentials ?
I obtain the following strange results (Sagemath 8.6):
`factor(exp(-x)+2*exp(x))` ---> `3*e^x`,
`factor(exp(-x)+x*exp(-x))` ---> `(x + 1)*e^x`
Any suggestions welcomed.Fri, 15 Feb 2019 06:40:40 -0600http://ask.sagemath.org/question/45469/wrong-factorization-of-expressions-containing-exponentials/Answer by eric_g for <p>Is there something wrong with the factorization of expressions containing exponentials ?
I obtain the following strange results (Sagemath 8.6): <br>
<code>factor(exp(-x)+2*exp(x))</code> ---> <code>3*e^x</code>, <br>
<code>factor(exp(-x)+x*exp(-x))</code> ---> <code>(x + 1)*e^x</code></p>
<p>Any suggestions welcomed.</p>
http://ask.sagemath.org/question/45469/wrong-factorization-of-expressions-containing-exponentials/?answer=45475#post-id-45475Thanks for the report. Looks like a terrible bug! It was introduced in SageMath 8.4: it is already there, while in SageMath 8.3, we get a mathematically correct result:
sage: factor(exp(-x)+2*exp(x))
(2*e^(2*x) + 1)*e^(-x)
I've opened the Trac ticket [#27304](https://trac.sagemath.org/ticket/27304) for it.Sat, 16 Feb 2019 07:55:15 -0600http://ask.sagemath.org/question/45469/wrong-factorization-of-expressions-containing-exponentials/?answer=45475#post-id-45475Comment by irizos for <p>Thanks for the report. Looks like a terrible bug! It was introduced in SageMath 8.4: it is already there, while in SageMath 8.3, we get a mathematically correct result:</p>
<pre><code>sage: factor(exp(-x)+2*exp(x))
(2*e^(2*x) + 1)*e^(-x)
</code></pre>
<p>I've opened the Trac ticket <a href="https://trac.sagemath.org/ticket/27304">#27304</a> for it.</p>
http://ask.sagemath.org/question/45469/wrong-factorization-of-expressions-containing-exponentials/?comment=45476#post-id-45476Thanks a lot for the reply. The bug is also present in cocalc.Sat, 16 Feb 2019 08:15:17 -0600http://ask.sagemath.org/question/45469/wrong-factorization-of-expressions-containing-exponentials/?comment=45476#post-id-45476