14.2 appears to have trouble with the Cauchy principal value of piecewise defined functions; Integrate is off while NIntegrate works:
In[1]:= Integrate[
Piecewise[{{1/x, x > 0}, {1 + 1/x, x < 0}}], {x, -5, 5},
PrincipalValue -> True]
Out[1]= -\[Infinity]
In[2]:= NIntegrate[
Piecewise[{{1/x, x > 0}, {1 + 1/x, x < 0}}], {x, -5, 0, 5},
Method -> "PrincipalValue"]
Out[2]= 5.
Am I doing anything wrong? If not: is this a known issue, are there workarounds?


Integrateas follows.f[x_] := Piecewise[{{1/x, x > 0}, {1 + 1/x, x < 0}}]; Integrate[f[x], {x, -5, 5}, GenerateConditions -> False]which now gives5. Screen shot i.sstatic.net/Kukb0VGy.png but usingGenerateConditions -> Falsemade Integrate skip the extra checking on poles and divergence? and that is why it gave same answer asNIntegrate$\endgroup$5usingCauchyPrincipalValue. So it looks like there is an issue withIntegratehere, assuming Maple and NIntegrate are both correct. Here is the code I used in Maplef:= x->piecewise(x>0,1/x,x<0,1+1/x): int(f(x), x=-5..5, 'CauchyPrincipalValue')and it gave5screen shot i.sstatic.net/JpYLx9L2.png using Maple 2025.2 on windows 10 $\endgroup$