Cauchy principal value integral
How can I calculate a Cauchy principal Value integral with sagemath
add a comment
How can I calculate a Cauchy principal Value integral with sagemath
Also:
from sympy import Integral
from sympy.abc import x
Integral(1/x, (x, -1, 1)).principal_value()
Use the definition, there is a limit, write explicitly the limit in sage.
For instance, ∫1−1dxx makes no sense as it is, but we may want to compute instead PV∫1−1dxx=PV∫1−1dxx:=lim This can be easily implemented:
var('a,x')
assume(a>0);
assume(a<1);
limit( integral(1/x, x, -1, -a) + integral(1/x, x, a, 1), a=0 )
We get zero.
Asked: 1 year ago
Seen: 133 times
Last updated: Oct 06 '23