@@ -952,8 +952,10 @@ class Integers(Builtin):
952
952
953
953
class Integrate (SympyFunction ):
954
954
r"""
955
- <url>:WMA link:
956
- https://reference.wolfram.com/language/ref/Integrate.html</url>
955
+ <url>:Integral:https://en.wikipedia.org/wiki/Integral</url> (<url>:SymPy:
956
+ https://docs.sympy.org/latest/modules/integrals/integrals.html</url>, \
957
+ <url>:WMA:
958
+ https://reference.wolfram.com/language/ref/Integrate.html</url>)
957
959
958
960
<dl>
959
961
<dt>'Integrate[$f$, $x$]'
@@ -984,18 +986,20 @@ class Integrate(SympyFunction):
984
986
>> Integrate[4 Sin[x] Cos[x], x]
985
987
= 2 Sin[x] ^ 2
986
988
987
- > Integrate[-Infinity, {x, 0, Infinity}]
989
+ >> Integrate[-Infinity, {x, 0, Infinity}]
988
990
= -Infinity
989
991
990
- > Integrate[-Infinity, {x, Infinity, 0}]
991
- = Infinity
992
+ Integrating something ill-defined returns the expression untouched:
992
993
993
- Integration in TeX:
994
+ >> Integrate[1, {x, Infinity, 0}]
995
+ = Integrate[1, {x, Infinity, 0}]
996
+
997
+ Here how is an example of converting integral equation to TeX:
994
998
>> Integrate[f[x], {x, a, b}] // TeXForm
995
999
= \int_a^b f\left[x\right] \, dx
996
1000
997
1001
Sometimes there is a loss of precision during integration.
998
- You can check the precision of your result with the following sequence
1002
+ You can check the precision of your result with the following sequence \
999
1003
of commands.
1000
1004
>> Integrate[Abs[Sin[phi]], {phi, 0, 2Pi}] // N
1001
1005
= 4.
@@ -1114,6 +1118,10 @@ def eval(self, f, xs, evaluation: Evaluation, options: dict): # type: ignore[ov
1114
1118
# e.g. NotImplementedError: Result depends on the sign of
1115
1119
# -sign(_u`j)*sign(_u`w)
1116
1120
return
1121
+ except TypeError :
1122
+ # SymPy can give this. For example:
1123
+ # Integrate[-Infinity, {x, 0, Infinity}]
1124
+ return
1117
1125
if prec is not None and isinstance (sympy_result , sympy .Integral ):
1118
1126
# TODO MaxExtraPrecision -> maxn
1119
1127
sympy_result = sympy_result .evalf (dps (prec ))
0 commit comments