Opened 9 years ago

## #13511 new enhancement

Reported by: Owned by: kcrisman burcin major sage-6.4 calculus N/A

### Description

In this sage-support thread, the question was raised about accessing principal values of divergent integrals when they exist. This is in Maxima, but we currently raise an error if the integral is divergent. Some options mentioned in the thread were having another parameter, another method, or something else.

### comment:1 Changed 8 years ago by jdemeyer

• Milestone changed from sage-5.11 to sage-5.12

### comment:2 Changed 8 years ago by vbraun_spam

• Milestone changed from sage-6.1 to sage-6.2

### comment:3 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.2 to sage-6.3

### comment:4 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.3 to sage-6.4

### comment:5 follow-up: ↓ 6 Changed 7 years ago by kcrisman

Perhaps more importantly, sometimes the principal value returned is correct even without considering improper integrals!

```(%i1) integral(sec(x), x, -%pi/4, %pi/4);
%pi  %pi
(%o1)                   integral(sec(x), x, - ---, ---)
4    4
(%i2) integrate(sec(x), x, -%pi/4, %pi/4);
Principal Value
sqrt(2) + 2          sqrt(2) - 2
(%o2)                log(-----------) - log(- -----------)
2                    2
```

See #17608.

### comment:6 in reply to: ↑ 5 ; follow-up: ↓ 7 Changed 7 years ago by nbruin

Perhaps more importantly, sometimes the principal value returned is correct even without considering improper integrals!

Isn't it a bug in maxima that it warns about Principal Value when it really is just the proper value?

### comment:7 in reply to: ↑ 6 Changed 7 years ago by kcrisman

Perhaps more importantly, sometimes the principal value returned is correct even without considering improper integrals!

Isn't it a bug in maxima that it warns about Principal Value when it really is just the proper value?

Possibly, though perhaps it's just saying this is how it was calculated. See https://sourceforge.net/p/maxima/bugs/2880/ which was the genesis of #17608. I feel like they are two separate tickets, however you can feel free to disagree and I won't object very strongly, it's quite amorphous.

### comment:8 Changed 7 years ago by nbruin

It gets even more exciting:

```(%i2) integrate(sec(x),x,0,%pi/4);

(%o2) log((sqrt(2)+2)/2)/2-log(-(sqrt(2)-2)/2)/2
(%i3) integrate(sec(x),x,-%pi/4,0);
Principal Value
(%o3) log((sqrt(2)+2)/2)/2-log(-(sqrt(2)-2)/2)/2
```
Note: See TracTickets for help on using tickets.