How do you compute the derivative of $\int_x^0\frac{\cos(xt)}{t}dt$? What is the derivative of $\int_x^0\frac{\cos(xt)}{t}dt$ with respect to $x$? Using Leibniz' rule, I think it equals
$$
\begin{align}
-\frac{\cos(x^2)}{x}+\int_x^0 -\sin(xt)dt &= -\frac{\cos(x^2)}{x}+\frac{\cos(xt)}{x}\bigg\vert_x^0 \\
&= \frac{1}{x}(1-2\cos(x^2))
\end{align}
$$
Is that all there is to it? I'm doubtful since Wolframalpha says something about the integral not converging.
 A: Before even talking about the derivative of a function, you need to check wether the function makes sense.
Let $$f(t)=\frac{\cos(tx)}{t}$$
Then $f$ is defined for every $t $ except $t=0$. If we want to start talking about
$$\int\limits_0^x {f(t)}dt  = \int\limits_0^x {\frac{{\cos (tx)}}{t}}dt $$
we thus have to take extra care about what happens near $0$. Clearly, we want to consider an improper integral. The function $f(t)$ is continuous on any $[\epsilon,x]$ for $x,\epsilon>0$, thus integrable on $[\epsilon,x]$, so we want to look at $\epsilon \to 0^+$. 
$$\int\limits_\epsilon ^x {f(t)}\,dt  = \int\limits_\epsilon ^x {\frac{{\cos (tx)}}{t}} \, dt$$
But
$$\frac{{\cos (tx)}}{t} = \frac{1}{t} - x^2\frac{{t{}}}{{2}} + o\left( {{t}} \right)$$
so,
$$\int\limits_\epsilon ^x {\frac{{\cos (tx)}}{t}}  = \log x \color{red}{- \log \epsilon } - {x^2}\frac{{{x^2}}}{4} + {x^2}\frac{{{\epsilon ^2}}}{4} + o(t^2)$$
Do you see now what's the problem when $\epsilon\to 0^+$?
A: I don't think it converges. The integrand goes like $t^{-1}$ near $t=0$, so would integrate to a lograrithmic divergence.
