Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Complement to Max's and Tolga's comments :

sage: var("t")
t
sage: with assuming(x>1): (e^(t^2)/sqrt(t)).integrate(t, 1, x^2)
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3

$$ -\frac{1}{2} \, \left(-1\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -1\right) + \frac{\left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{3}} $$

As you can see, this expression involves different inherently non-real complex factors (fractional powers of negative numbers, $\Gamma$ with negative arguments), whose sums happens to be real. The computation of the numerical value is inexact, so a small inexactitude is enough to result in a numerically non-zero imaginary part.

Showing that this imaginary part is zero seems out of reach of current CASses...

Complement to Max's and Tolga's comments :

sage: var("t")
t
sage: with assuming(x>1): (e^(t^2)/sqrt(t)).integrate(t, 1, x^2)
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3

$$ -\frac{1}{2} \, \left(-1\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -1\right) + \frac{\left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{3}} $$

As you can see, this expression involves different inherently non-real complex factors (fractional powers of negative numbers, $\Gamma$ with negative arguments), whose sums happens to be real. The computation of the numerical value is inexact, so a small inexactitude is enough to result in a numerically non-zero imaginary part.

Showing that this imaginary part is zero seems out of reach of current CASses...

EDIT : To illistrate Max's comment about derivation :

sage: with assuming(x>1): foo=(e^(t^2)/sqrt(t)).integrate(t, 1, x^2) ; foo
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3
sage: foo.diff(x)
-2*(-x^4)^(3/4)*D[1](gamma)(1/4, -x^4) - 3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) - 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4

$$ -2 \, \left(-x^{4}\right)^{\frac{3}{4}} \mathrm{D}_{1}\left(\Gamma\right)\left(\frac{1}{4}, -x^{4}\right) - \frac{3 \, \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, \left(-x^{4}\right)^{\frac{1}{4}}} - \frac{3 \, \left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{4}} $$

Complement to Max's and Tolga's comments :

sage: var("t")
t
sage: with assuming(x>1): (e^(t^2)/sqrt(t)).integrate(t, 1, x^2)
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3

$$ -\frac{1}{2} \, \left(-1\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -1\right) + \frac{\left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{3}} $$

As you can see, this expression involves different inherently non-real complex factors (fractional powers of negative numbers, $\Gamma$ with negative arguments), whose sums happens to be real. The computation of the numerical value is inexact, so a small inexactitude is enough to result in a numerically non-zero imaginary part.

Showing that this imaginary part is zero seems out of reach of current CASses...

EDIT : To illistrate Max's comment about derivation :

sage: with assuming(x>1): foo=(e^(t^2)/sqrt(t)).integrate(t, 1, x^2) ; foo
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3
sage: foo.diff(x)
-2*(-x^4)^(3/4)*D[1](gamma)(1/4, -x^4) - 3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) - 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4

$$ -2 \, \left(-x^{4}\right)^{\frac{3}{4}} \mathrm{D}_{1}\left(\Gamma\right)\left(\frac{1}{4}, -x^{4}\right) - \frac{3 \, \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, \left(-x^{4}\right)^{\frac{1}{4}}} - \frac{3 \, \left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{4}} $$

One notes that Sage does not explicites a derivative of $\Gamma$ wrt one of its arguments... Neither does Mathematica :

sage: foo._mathematica_().diff(x)
diff[-1/2*((-1)^(3/4)*Gamma[1/4, -1]) + ((-x^4)^(3/4)*Gamma[1/4, -x^4])/
   (2*x^3), x]

Suspicious :

sage: giac.diff(*map(giac, (foo, x)))._sage_()
-3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) - 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4 + 2*e^(x^4)

$$ -\frac{3 \, \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, \left(-x^{4}\right)^{\frac{1}{4}}} - \frac{3 \, \left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{4}} + 2 \, e^{\left(x^{4}\right)} $$

Highly suspicious :

sage: fricas.D(*map(fricas, (foo, x)))._sage_()
2*e^(x^4)

But these expressions tun out to be equal :

sage: (fricas.D(*map(fricas, (foo, x)))._sage_()-giac.diff(*map(giac, (foo, x)))._sage_())
3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) + 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4
sage: (fricas.D(*map(fricas, (foo, x)))._sage_()-giac.diff(*map(giac, (foo, x)))._sage_()).factor()
0

and comparing the Fricas result to a (rough) numerical estimate of the derivative of the function shows a very good agreement : their quotient is 1 up to $10^-6$ on the range (1, 4) :

sage: plot(lambda u:((Foo(u+1e-8)-Foo(u))/1e-8).real()/(2*e^(u^4))-1, (1, 4))
Launched png viewer for Graphics object consisting of 1 graphics primitive

image description

Frcas' and Giac's derivations seem to be exact. The Sage's $\Gamma$ implementation may be perfected...

HTH,

Complement to Max's and Tolga's comments :

sage: var("t")
t
sage: with assuming(x>1): (e^(t^2)/sqrt(t)).integrate(t, 1, x^2)
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3

$$ -\frac{1}{2} \, \left(-1\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -1\right) + \frac{\left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{3}} $$

As you can see, this expression involves different inherently non-real complex factors (fractional powers of negative numbers, $\Gamma$ with negative arguments), whose sums happens to be real. The computation of the numerical value is inexact, so a small inexactitude is enough to result in a numerically non-zero imaginary part.

Showing that this imaginary part is zero seems out of reach of current CASses...

EDIT : To illistrate Max's comment about derivation :

sage: with assuming(x>1): foo=(e^(t^2)/sqrt(t)).integrate(t, 1, x^2) ; foo
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3
sage: foo.diff(x)
-2*(-x^4)^(3/4)*D[1](gamma)(1/4, -x^4) - 3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) - 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4

$$ -2 \, \left(-x^{4}\right)^{\frac{3}{4}} \mathrm{D}_{1}\left(\Gamma\right)\left(\frac{1}{4}, -x^{4}\right) - \frac{3 \, \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, \left(-x^{4}\right)^{\frac{1}{4}}} - \frac{3 \, \left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{4}} $$

One notes that Sage does not explicites a derivative of $\Gamma$ wrt one of its arguments... Neither does Mathematica :

sage: foo._mathematica_().diff(x)
diff[-1/2*((-1)^(3/4)*Gamma[1/4, -1]) + ((-x^4)^(3/4)*Gamma[1/4, -x^4])/
   (2*x^3), x]

Suspicious :

sage: giac.diff(*map(giac, (foo, x)))._sage_()
-3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) - 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4 + 2*e^(x^4)

$$ -\frac{3 \, \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, \left(-x^{4}\right)^{\frac{1}{4}}} - \frac{3 \, \left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{4}} + 2 \, e^{\left(x^{4}\right)} $$

Highly suspicious :

sage: fricas.D(*map(fricas, (foo, x)))._sage_()
2*e^(x^4)

But these expressions tun out to be equal :

sage: (fricas.D(*map(fricas, (foo, x)))._sage_()-giac.diff(*map(giac, (foo, x)))._sage_())
3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) + 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4
sage: (fricas.D(*map(fricas, (foo, x)))._sage_()-giac.diff(*map(giac, (foo, x)))._sage_()).factor()
0

and comparing the Fricas result to a (rough) numerical estimate of the derivative of the function shows a very good agreement : their quotient is 1 up to $10^-6$ $10^{-6}$ on the range (1, 4) :

sage: plot(lambda u:((Foo(u+1e-8)-Foo(u))/1e-8).real()/(2*e^(u^4))-1, (1, 4))
Launched png viewer for Graphics object consisting of 1 graphics primitive

image description

Frcas' and Giac's derivations seem to be exact. The Sage's $\Gamma$ implementation may be perfected...

HTH,

Complement to Max's and Tolga's comments :

sage: var("t")
t
sage: with assuming(x>1): (e^(t^2)/sqrt(t)).integrate(t, 1, x^2)
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3

$$ -\frac{1}{2} \, \left(-1\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -1\right) + \frac{\left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{3}} $$

As you can see, this expression involves different inherently non-real complex factors (fractional powers of negative numbers, $\Gamma$ with negative arguments), whose sums happens to be real. The computation of the numerical value is inexact, so a small inexactitude is enough to result in a numerically non-zero imaginary part.

Showing that this imaginary part is zero seems out of reach of current CASses...

EDIT : To illistrate Max's comment about derivation :

sage: with assuming(x>1): foo=(e^(t^2)/sqrt(t)).integrate(t, 1, x^2) ; foo
-1/2*(-1)^(3/4)*gamma(1/4, -1) + 1/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^3
sage: foo.diff(x)
-2*(-x^4)^(3/4)*D[1](gamma)(1/4, -x^4) - 3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) - 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4

$$ -2 \, \left(-x^{4}\right)^{\frac{3}{4}} \mathrm{D}_{1}\left(\Gamma\right)\left(\frac{1}{4}, -x^{4}\right) - \frac{3 \, \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, \left(-x^{4}\right)^{\frac{1}{4}}} - \frac{3 \, \left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{4}} $$

One notes that Sage does not explicites a derivative of $\Gamma$ wrt one of its arguments... Neither does Mathematica :

sage: foo._mathematica_().diff(x)
diff[-1/2*((-1)^(3/4)*Gamma[1/4, -1]) + ((-x^4)^(3/4)*Gamma[1/4, -x^4])/
   (2*x^3), x]
arguments...

Suspicious :

sage: giac.diff(*map(giac, (foo, x)))._sage_()
-3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) - 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4 + 2*e^(x^4)

$$ -\frac{3 \, \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, \left(-x^{4}\right)^{\frac{1}{4}}} - \frac{3 \, \left(-x^{4}\right)^{\frac{3}{4}} \Gamma\left(\frac{1}{4}, -x^{4}\right)}{2 \, x^{4}} + 2 \, e^{\left(x^{4}\right)} $$

Highly suspicious :

sage: fricas.D(*map(fricas, (foo, x)))._sage_()
2*e^(x^4)

and, BTW :

sage: foo._sympy_().diff(x._sympy_())._sage_()
2*e^(x^4)
sage: foo._mathematica_().D(x).FullSimplify().sage()
2*e^(x^4)

But these expressions tun out to be equal :

sage: (fricas.D(*map(fricas, (foo, x)))._sage_()-giac.diff(*map(giac, (foo, x)))._sage_())
3/2*gamma(1/4, -x^4)/(-x^4)^(1/4) + 3/2*(-x^4)^(3/4)*gamma(1/4, -x^4)/x^4
sage: (fricas.D(*map(fricas, (foo, x)))._sage_()-giac.diff(*map(giac, (foo, x)))._sage_()).factor()
0

and comparing the Fricas result to a (rough) numerical estimate of the derivative of the function shows a very good agreement : their quotient is 1 up to $10^{-6}$ on the range (1, 4) :

sage: plot(lambda u:((Foo(u+1e-8)-Foo(u))/1e-8).real()/(2*e^(u^4))-1, (1, 4))
Launched png viewer for Graphics object consisting of 1 graphics primitive

image description

Frcas' Mathematica's, Fricas' and Giac's derivations seem to be exact. The Sage's $\Gamma$ implementation may be perfected...

HTH,