|
218 | 218 |
|
219 | 219 | init_code = ['besselexpand : true', 'display2d : false', 'domain : complex', 'keepfloat : true',
|
220 | 220 | 'load(to_poly_solve)', 'load(simplify_sum)',
|
221 |
| - 'load(diag)'] |
| 221 | + 'load(diag)', 'load(abs_integrate)'] |
222 | 222 |
|
223 | 223 |
|
224 | 224 | # Turn off the prompt labels, since computing them *very
|
@@ -759,19 +759,43 @@ def sr_integral(self, *args):
|
759 | 759 | sage: a.imag().abs() < 3e-17
|
760 | 760 | True
|
761 | 761 |
|
762 |
| - The following examples (at least for now) require Maxima's |
763 |
| - ``abs_integrate`` package. Enabling ``abs_integrate`` globally |
764 |
| - caused several bugs catalogued in :issue:`12731`, so we no |
765 |
| - longer load it by default, but you can load it manually by |
766 |
| - running ``maxima_calculus.eval("load(abs_integrate)")``. |
767 |
| - Afterwards, these integrals should produce a meaningful |
768 |
| - result; but be warned, there is no way to unload the |
769 |
| - ``abs_integrate`` package once it is loaded:: |
770 |
| -
|
771 |
| - sage: integrate(1/(abs(x) + 1), x) |
772 |
| - integrate(1/(abs(x) + 1), x) |
773 |
| - sage: integrate(cos(x + abs(x)), x) |
774 |
| - integrate(cos(x + abs(x)), x) |
| 762 | + The following examples require Maxima's ``abs_integrate`` |
| 763 | + package. Enabling ``abs_integrate`` globally caused several |
| 764 | + bugs (catalogued in :issue:`12731`) but most of these have |
| 765 | + been fixed, and ``abs_integrate`` has been re-enabled:: |
| 766 | +
|
| 767 | + sage: integrate(1/(abs(x) + 1), x, algorithm="maxima") |
| 768 | + 1/2*(log(x + 1) + log(-x + 1))*sgn(x) + 1/2*log(x + 1) - 1/2*log(-x + 1) |
| 769 | + sage: integrate(cos(x + abs(x)), x, algorithm="maxima") |
| 770 | + -1/4*(2*x - sin(2*x))*sgn(x) + 1/2*x + 1/4*sin(2*x) |
| 771 | +
|
| 772 | + Several examples where ``abs_integrate`` previously lead to |
| 773 | + incorrect results. This was once reported to be divergent in |
| 774 | + :issue:`13733`:: |
| 775 | +
|
| 776 | + sage: # long time |
| 777 | + sage: integral(log(cot(x)-1), x, 0, pi/4, algorithm="maxima") |
| 778 | + catalan + 1/2*I*dilog(1/2*I + 1/2) - 1/2*I*dilog(-1/2*I + 1/2) |
| 779 | +
|
| 780 | + This used to return ``1/2`` in :issue:`11590`:: |
| 781 | +
|
| 782 | + sage: integrate(x * sgn(x^2 - 1/4), x, -1, 0, algorithm="maxima") |
| 783 | + -1/4 |
| 784 | +
|
| 785 | + In :issue:`14591`, this incorrectly simplified to ``cosh(x)``:: |
| 786 | +
|
| 787 | + sage: integrate(sqrt(1-1/4*cosh(x)^2), x, algorithm="maxima") |
| 788 | + integrate(sqrt(-1/4*cosh(x)^2 + 1), x) |
| 789 | +
|
| 790 | + In :issue:`17468`, this integral hangs:: |
| 791 | +
|
| 792 | + sage: integral(log(abs(2*sin(x))), x, 0, pi/3, algorithm="maxima") |
| 793 | + 1/36*I*pi^2 + I*dilog(1/2*I*sqrt(3) + 1/2) + I*dilog(-1/2*I*sqrt(3) - 1/2) |
| 794 | +
|
| 795 | + This used to return a *negative* answer in :issue:`17511`:: |
| 796 | +
|
| 797 | + sage: integrate(abs(cos(x)), x, 0, pi, algorithm="maxima") |
| 798 | + 2 |
775 | 799 |
|
776 | 800 | """
|
777 | 801 | try:
|
|
0 commit comments