

last edited 8 months ago by test1 
1 2 3  
Editor: test1
Time: 2018/02/08 16:15:38 GMT+0 

Note: 
added:
From test1 Thu Feb 8 16:15:37 +0000 2018
From: test1
Date: Thu, 08 Feb 2018 16:15:37 +0000
Subject:
MessageID: <20180208161537+0000@axiomwiki.newsynthesis.org>
Status: fix proposed => closed
For some reason, the following forgets about one summand:
integrate(exp(x^2)+exp(x)/x,x)
(1) 
expintegratepoly$INTTR
. There you find the following definition:
 returns either  (q in GP, a in F) st p = q' + a, and a=0 or a has no integral in F  or (q in GP, r in GP) st p = q' + r, and r has no integral elem/UP expintegratepoly(p, FRDE) == coef0:F := 0 notelm := answr := 0$GP while p ^= 0 repeat ans1 := FRDE(n := degree p, a := leadingCoefficient p) answr := answr + monomial(ans1.ans, n) if ~ans1.sol? then  Risch d.e. has no complete solution missing := a  ans1.right if zero? n then coef0 := missing else notelm := notelm + monomial(missing, n) p := reductum p zero? notelm => [answr, coef0] [answr, notelm]
In principle, this function takes a polynomial p
and tries to integrate every coefficient. If it finds an answer, it adds it to answr
, otherwise to notelm
. Note however, that the constant term of the p
will never get added to notelm
, even if it was not possible to integrate it. So maybe the last line should read:
[answr, notelm+monomial(coef0, 0)]
This seems to "work", i.e., the integrals are then returned unevaluated. However, I'd rather have axiom to use the linearity of the integral... Note that
integrate(exp(x^2)+sin(x),x)
(2) 
is an example for an integral where coef0
does not vanish but notelm
does. So the more drastic change:
if ~ans1.sol? then  Risch d.e. has no complete solution missing := a  ans1.right if zero? n then coef0 := missing notelm := notelm + monomial(missing, n) p := reductum p zero? notelm => [answr, coef0] [answr, notelm]
is not necessary  but does not produce wrong results either.
By the way, here are some other  strange  manifestation of the same bug:
integrate(exp(x^2)+1/x,x)
(3) 
integrate(exp(x)/x+1/x,x)
(4) 
Although is certainly elementary, and so is its integral, the bug manifests itself.
Martin
Status: open => fix proposed Name:#199 integratee^(x^2)
=> #199 #199 integrate(exp(x^2)+exp(x)/x,x)
Name: #199 #199 integrate(exp(x^2)+exp(x)/x,x)
=> #199 integrate(exp(x^2)+exp(x)/x,x)