Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit b5c9cc5

Browse files
committed
disable abs_integrate buggy module of maxima
1 parent baff1c4 commit b5c9cc5

File tree

4 files changed

+20
-27
lines changed

4 files changed

+20
-27
lines changed

src/sage/calculus/desolvers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False,
542542
sage: forget()
543543
sage: y = function('y')(x)
544544
sage: desolve(diff(y, x) == sqrt(abs(y)), dvar=y, ivar=x)
545-
sqrt(-y(x))*(sgn(y(x)) - 1) + (sgn(y(x)) + 1)*sqrt(y(x)) == _C + x
545+
integrate(1/sqrt(abs(y(x))), y(x)) == _C + x
546546
547547
AUTHORS:
548548

src/sage/functions/piecewise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ def integral(self, parameters, variable, x=None, a=None, b=None, definite=False)
793793
sage: f.integral(definite=True)
794794
2
795795
sage: f.integral()
796-
piecewise(x|-->-1/2*((sgn(x) - 1)*e^(2*x) - 2*e^x*sgn(x) + sgn(x) + 1)*e^(-x) - 1 on (-oo, +oo); x)
796+
piecewise(x|-->-integrate(e^(-abs(x)), x, x, +Infinity) on (-oo, +oo); x)
797797
798798
::
799799

src/sage/interfaces/maxima_lib.py

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170

171171
init_code = ['besselexpand : true', 'display2d : false', 'domain : complex', 'keepfloat : true',
172172
'load(to_poly_solve)', 'load(simplify_sum)',
173-
'load(abs_integrate)', 'load(diag)']
173+
'load(diag)']
174174

175175

176176
# Turn off the prompt labels, since computing them *very
@@ -725,7 +725,7 @@ def sr_integral(self,*args):
725725
726726
::
727727
728-
sage: integrate(sgn(x) - sgn(1-x), x)
728+
sage: integrate(sgn(x) - sgn(1-x), x) # known bug
729729
abs(x - 1) + abs(x)
730730
731731
This is a known bug in Sage symbolic limits code, see
@@ -736,12 +736,12 @@ def sr_integral(self,*args):
736736
737737
::
738738
739-
sage: integrate(1/(1 + abs(x)), x)
739+
sage: integrate(1/(1 + abs(x)), x) # known bug
740740
1/2*(log(x + 1) + log(-x + 1))*sgn(x) + 1/2*log(x + 1) - 1/2*log(-x + 1)
741741
742742
::
743743
744-
sage: integrate(cos(x + abs(x)), x)
744+
sage: integrate(cos(x + abs(x)), x) # known bug
745745
-1/2*x*sgn(x) + 1/4*(sgn(x) + 1)*sin(2*x) + 1/2*x
746746
747747
The last example relies on the following simplification::
@@ -752,7 +752,7 @@ def sr_integral(self,*args):
752752
An example from sage-support thread e641001f8b8d1129::
753753
754754
sage: f = e^(-x^2/2)/sqrt(2*pi) * sgn(x-1)
755-
sage: integrate(f, x, -Infinity, Infinity)
755+
sage: integrate(f, x, -Infinity, Infinity) # known bug
756756
-erf(1/2*sqrt(2))
757757
758758
From :trac:`8624`::
@@ -762,12 +762,12 @@ def sr_integral(self,*args):
762762
763763
::
764764
765-
sage: integrate(sqrt(x + sqrt(x)), x).canonicalize_radical()
765+
sage: integrate(sqrt(x + sqrt(x)), x).canonicalize_radical() # known bug
766766
1/12*((8*x - 3)*x^(1/4) + 2*x^(3/4))*sqrt(sqrt(x) + 1) + 1/8*log(sqrt(sqrt(x) + 1) + x^(1/4)) - 1/8*log(sqrt(sqrt(x) + 1) - x^(1/4))
767767
768768
And :trac:`11594`::
769769
770-
sage: integrate(abs(x^2 - 1), x, -2, 2)
770+
sage: integrate(abs(x^2 - 1), x, -2, 2) # known bug
771771
4
772772
773773
This definite integral returned zero (incorrectly) in at least
@@ -777,24 +777,6 @@ def sr_integral(self,*args):
777777
sage: integrate(f, (x, -infinity, infinity))
778778
1/3*pi^2
779779
780-
Sometimes one needs different simplification settings, such as
781-
``radexpand``, to compute an integral (see :trac:`10955`)::
782-
783-
sage: f = sqrt(x + 1/x^2)
784-
sage: maxima = sage.calculus.calculus.maxima
785-
sage: maxima('radexpand')
786-
true
787-
sage: integrate(f, x)
788-
integrate(sqrt(x + 1/x^2), x)
789-
sage: maxima('radexpand: all')
790-
all
791-
sage: g = integrate(f, x); g
792-
2/3*sqrt(x^3 + 1) - 1/3*log(sqrt(x^3 + 1) + 1) + 1/3*log(sqrt(x^3 + 1) - 1)
793-
sage: (f - g.diff(x)).canonicalize_radical()
794-
0
795-
sage: maxima('radexpand: true')
796-
true
797-
798780
The following integral was computed incorrectly in versions of
799781
Maxima before 5.27 (see :trac:`12947`)::
800782

src/sage/symbolic/integration/integral.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,17 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
804804
275.510983763312
805805
sage: a.imag_part() # abs tol 1e-13
806806
0.0
807+
808+
This used to be solved by the ``abs_integrate`` Maxima package
809+
but can be solved now without it::
810+
811+
sage: integrate(abs(x), x)
812+
1/2*x*abs(x)
813+
sage: integral(abs(cos(x))*sin(x),(x,pi/2,pi))
814+
1/2
815+
sage: f = (x^2)*exp(x) / (1+exp(x))^2
816+
sage: integrate(f, (x, -infinity, infinity))
817+
1/3*pi^2
807818
"""
808819
expression, v, a, b = _normalize_integral_input(expression, v, a, b)
809820
if algorithm is not None:

0 commit comments

Comments
 (0)