Discussion:
[fricas-devel] potential bug in integration
'Martin R' via FriCAS - computer algebra system
2018-06-18 14:39:42 UTC
Permalink
Hi integration gurus!

It seems to me that the integral of log(x)^(-t-1) is possibly incorrect:

(6) -> f := log(x)^(-t)

- t
(6) log(x)
Type:
Expression(Integer)
(7) -> r := integrate(f, x)

(7) cos(%pi t)Gamma(- t + 1,- log(x))
Type:
Union(Expression(Integer),...)
(8) -> D(r, x) - f

- t - t
(8) - log(x) + cos(%pi t)(- log(x))
Type:
Expression(Integer)

But this only vanishes for integers t. It seems that maxima returns the
correct integral:

sage: f = log(x)^(-t-1)
sage: f_int = integrate(f,x, algorithm="fricas"); f_int #
optional - fricas

cos(pi + pi*t)*gamma(-t, -log(x))
sage: [(diff(f_int, x) - f).subs(t=k/2).full_simplify() for k in
range(-5,5)] # optional - fricas

[-log(x)^(3/2),
0,
-sqrt(log(x)),
0,
-1/sqrt(log(x)),
0,
-1/log(x)^(3/2),
0,
-1/log(x)^(5/2),
0]
sage: f_int = integrate(f,x, algorithm="maxima"); f_int
-(-log(x))^t*log(x)^(-t)*gamma(-t, -log(x))
sage: [(diff(f_int, x) - f).subs(t=k/2).full_simplify() for k in
range(-5,5)]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

All the best,

Martin
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Waldek Hebisch
2018-06-18 15:05:10 UTC
Permalink
Post by 'Martin R' via FriCAS - computer algebra system
Hi integration gurus!
(6) -> f := log(x)^(-t)
- t
(6) log(x)
Expression(Integer)
(7) -> r := integrate(f, x)
(7) cos(%pi t)Gamma(- t + 1,- log(x))
Union(Expression(Integer),...)
(8) -> D(r, x) - f
- t - t
(8) - log(x) + cos(%pi t)(- log(x))
Expression(Integer)
Yes. Internally (as shown by ")trace INTEF )math") integrator
produces

t log(- 1)
%e Gamma(- t + 1,- log(x))

but this is messed up by later postprocessing. This is _very_ old
problem, but seem to show up with some frequency in integrals
involving Gamma (due to inconvenient choice of branches in
standard definition).
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Loading...