Cauchy principal value integral
How can I calculate a Cauchy principal Value integral with sagemath
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, $$\int_{-1}^1\frac{dx}x$$ makes no sense as it is, but we may want to compute instead $$ \text{PV}\int_{-1}^1\frac{dx}x =\text{PV}\int_{-1}^1\frac{dx}x := \lim_{a\searrow0}\text{PV}\int_{[-1,-a]\cup[a,1]}\frac{dx}x \ . $$ 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.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2023-10-06 10:01:55 +0100
Seen: 105 times
Last updated: Oct 06 '23