Oddities in the Definition of IntegralCosinus ${\rm Ci}(x)$ Reading the defintion of the IntegralCosinus
$$
{\rm Ci}(x) = \gamma + \ln x + \int_0^x\frac{\cos t-1}{t}\,dt 
$$
I wonder what happens, if I to split the function in the integral:
$$
\begin{eqnarray*}
{\rm Ci}(x) &=& \gamma + \ln x + \int_0^x\frac{\cos t}{t}\,dt -\int_0^x\frac{1}{t}\,dt \\
&=& \gamma + \ln x + \int_0^x\frac{\cos t}{t}\,dt -\left[ \ln (t) \right]_0^x \\
&=& \gamma + \ln x + \int_0^x\frac{\cos t}{t}\,dt -\ln(x) + \underbrace{\ln(0)}_? \tag{1} \\
\end{eqnarray*}
$$
Is splitting not allowed here or how do I have to interprete $\ln(0)$?
And further if I look at another definition
$$
    -{\rm Ci}(x) = \int_x^\infty\frac{\cos t}{t}\,dt \tag{2}
$$
and now add $(1)$ and $(2)$ I get:
$$
0=\gamma + \int_0^\infty\frac{\cos t}{t}\,dt
$$
This doesn't seem right. Can anybody tell me what's wrong here?
 A: This is questionable:
$$
\int_0^x\frac{\cos t - 1}{t}\,dt
= \int_0^x\frac{\cos t}{t}\,dt -\int_0^x\frac{1}{t}\,dt
$$
A convergent integral written as the difference of two divergent integrals.
A: In the first definition, $\log(x)$ is not defined for $x = 0$, and in the second definition, the integral is not defined when $x = 0$, so adding the two results together is not a valid operation when $x = 0$.
A: Notice that
$$
\frac{\cos t}{t} \to \infty\text{ as }t \downarrow 0 
$$
and
$$
\frac 1t \to \infty\text{ as }t\downarrow 0
$$
but
$$
\frac{\cos t - 1}{t} \to 0\text{ as }t\downarrow 0.
$$
So it makes sense to speak of the integral of this last fraction from $0$ to $x$.  What about the first two?  Notice that for $x>0$,
$$
\int_0^x \frac 1t\;dt = \infty
$$
and
$$
\int_0^x \frac{\cos t}{t}\;dt \ge \int_0^{\cos x} \frac 1t\;dt = \infty.
$$
But the integral of the difference is the integral of a bounded function, so it's well-behaved.
(But don't conclude that $\infty-\infty=0$.  There are instances of two functions approaching $\infty$ while their difference approaches $6$.  And similarly with any other number in place of $6$.)
