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.Mon, 14 Sep 2015 00:21:15 +0200Possible error in Sagehttps://ask.sagemath.org/question/29432/possible-error-in-sage/Dear all, while trying to calculate the integral of:
integrate (x*e^(2*x-(x^2)/2), x)
I got this:
1/2*I*sqrt(2)*(-2*I*sqrt(pi)*(x - 2)*(erf(sqrt(1/2)*sqrt((x - 2)^2)) - 1)/sqrt((x - 2)^2) + I*sqrt(2)*e^(-1/2*(x - 2)^2))*e^2
Which is actually wrong.
The answer is simply e^x²
Cheers
SergioFri, 11 Sep 2015 19:19:33 +0200https://ask.sagemath.org/question/29432/possible-error-in-sage/Comment by tmonteil for <p>Dear all, while trying to calculate the integral of:</p>
<p>integrate (x<em>e^(2</em>x-(x^2)/2), x)</p>
<p>I got this:</p>
<p>1/2<em>I</em>sqrt(2)<em>(-2</em>I<em>sqrt(pi)</em>(x - 2)<em>(erf(sqrt(1/2)</em>sqrt((x - 2)^2)) - 1)/sqrt((x - 2)^2) + I<em>sqrt(2)</em>e^(-1/2<em>(x - 2)^2))</em>e^2</p>
<p>Which is actually wrong.</p>
<p>The answer is simply e^x²</p>
<p>Cheers</p>
<p>Sergio</p>
https://ask.sagemath.org/question/29432/possible-error-in-sage/?comment=29434#post-id-29434Are you sure about your statement ? The derivative of `e^(x^2)` is `2*x*e^(x^2)`, which seem not equal to your first function.Fri, 11 Sep 2015 21:11:28 +0200https://ask.sagemath.org/question/29432/possible-error-in-sage/?comment=29434#post-id-29434Comment by Chernoxyl for <p>Dear all, while trying to calculate the integral of:</p>
<p>integrate (x<em>e^(2</em>x-(x^2)/2), x)</p>
<p>I got this:</p>
<p>1/2<em>I</em>sqrt(2)<em>(-2</em>I<em>sqrt(pi)</em>(x - 2)<em>(erf(sqrt(1/2)</em>sqrt((x - 2)^2)) - 1)/sqrt((x - 2)^2) + I<em>sqrt(2)</em>e^(-1/2<em>(x - 2)^2))</em>e^2</p>
<p>Which is actually wrong.</p>
<p>The answer is simply e^x²</p>
<p>Cheers</p>
<p>Sergio</p>
https://ask.sagemath.org/question/29432/possible-error-in-sage/?comment=29437#post-id-29437yeah the function you first stated is x*(e^(2x-(x^2)/2)) which is not equal to e^x^2, also (according to sage) the integral of your stated function is what you stated and for e^x^2 the integral is -sqrt(pi)i/2 * erf(ix)Mon, 14 Sep 2015 00:21:15 +0200https://ask.sagemath.org/question/29432/possible-error-in-sage/?comment=29437#post-id-29437