Show that $$\int_0^x \frac{1-\cos(t)}{t}=\gamma+\ln(x)-\operatorname{Ci}(x)$$ where $$\operatorname{Ci}(x)=-\int_x^\infty \frac{\cos(t)}{t} \, dt$$ and gamma is an euler-mascheroni constant. I did as follows: $$\int_0^x \frac{1-\cos(t)}{t} \, dt=\int_0^x \frac{1}{t} \,dt-\int_0^x \frac{\cos(t)}{t}\,dt$$ $$=\int_0^x \frac{1}{t}\,dt-\int_0^\infty \frac{\cos(t)}{t}\,dt+\int_x^\infty \frac{\cos(t)}{t} \, dt=\int_0^x \frac{1}{t}-\int_0^\infty \frac{\cos(t)}{t}-\operatorname{Ci}(x)$$
I am stuck with the last two integrals. How do I proceed? A shorthand notation tells me that I get $\ln(x)-\ln(0)-\Gamma(0)$ which is wrong since $\ln(0)$ and $\Gamma(0)$ are undefined unless $$\ln(0)+\Gamma(0)=-\gamma$$