# Cauchy principal value integral

How can I calculate a Cauchy principal Value integral with sagemath

Cauchy principal value integral

How can I calculate a Cauchy principal Value integral with sagemath

add a comment

0

Also:

```
from sympy import Integral
from sympy.abc import x
Integral(1/x, (x, -1, 1)).principal_value()
```

0

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 +0200 **

Seen: **54 times**

Last updated: **Oct 06 '23**

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.