# Why does Mathematica not know some integrals diverge?

I want to analyse the convergence of some complicated 1d integrals that may have divergences at $$x=0$$, similarly to the harmonic integral $$\int_0^a 1/x \ \mathbb{d} x$$, which I know is divergent. When I try

Integrate[1/x,{x,0,10}]


Mathematica neither solves the integral, nor tell it is divergent. If I try

Integrate[1/x, x]


It gives the correct answer, $$log(x)$$, however when I try to numerically calculate the integral with

NIntegrate[1/x, {x, 0, 10}]


It gives no error or warning message, rather a finite result! I tried to play with PrecisionGoal but I still couldn't get any error. Is there a way for Mathematica to spot more accurately non convergent integrals? The integrals I want to analyse might suffer from the same issues and have no analytical solution, so I am afraid I might not spot the divergences.

• On MMA 13.0: Integrate[1/x, {x, 0, 10}] give me: "Integral of 1/x does not converge on {0,10}". This message is generated when the indicated definite integral does not converge. May 13 at 12:08
• I have mathematica 12, maybe that's what happening? May 13 at 12:12
• Also in 13: NIntegrate[1/x, {x, 0, 10}] says "NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections.... " Limit[Integrate[1/x, {x, ep, 10}], ep -> 0] returns "Indeterminate". May 13 at 14:18
• Thanks! I updated to Mathematica 13 and now I do get these messages, so I definitely think it was an issue of Mathematica 12 May 13 at 15:17