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.Sat, 16 Feb 2019 15:15:17 +0100Wrong factorization of expressions containing exponentials ?https://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 13:40:40 +0100https://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>
https://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 14:55:15 +0100https://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>
https://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 15:15:17 +0100https://ask.sagemath.org/question/45469/wrong-factorization-of-expressions-containing-exponentials/?comment=45476#post-id-45476