Solve the integral Cos(x)/x at the interval (0,infinite)

Dear All,

I am trying to find Integral[Cos[x]/x,{x,0,infinite}].
Integrate can not give a result since the expression is divergent.
However, NIntegrate gives a result that I do not trust.

Integrate[1/x Cos[x], {x, 0, \[Infinity]}]
NIntegrate[1/x Cos[x], {x, 0, \[Infinity]}]

Does anyone know if this integral can be taken? And how can we trust the result?

Best wishes,

İsa

The integral diverges because of the singularity at x==0. NIntegrate does not commit, but it gives serious warnings. Compare with converging integrals:

Integrate[1/x Sin[x], {x, 0, \[Infinity]}]
NIntegrate[1/x Sin[x], {x, 0, \[Infinity]}]

int = Integrate[Cos/(x + e), {x, 0, [Infinity]}, Assumptions → e >= 0]
Limit[int, e → 0]

(* \[Infinity] *)

It is somewhat disappointing that NIntegrate does not decide at once that the integral diverges.

The value of the integral is Infinity, in this sense:

Integrate[Cos[x]/x, {x, a, b}]
Limit[%, {a -> 0, b -> Infinity},
 Direction -> {"FromAbove", "FromBelow"}]