Find the derivative of the following integral Find the derivative of $f(x)= \int_x^0 \frac{\cos(xt)}{t} dt$.
My first reaction was to apply the FTOC, but I don't believe I can do this because $\frac{\cos(xt)}{t}$ is not defined at $t=0$ and thus it is not continuous in the interval of integration. I am trying to re-learn calculus after being away from it for so long and I am a bit rusty. My book doesn't give a clear solution, so any pointers on what to do in this situation would be greatly appreciated.
Edit: After some internet digging, I've learned that what I need to solve the problem is differetiation under the integral sign, which states $$\frac{d}{dx}(\int_{a(x)}^{b(x)}f(x,t) dt)=f(x,b(x))\cdot b'(x) - f(x,a(x))\cdot a'(x)+\int_{a(x)}^{b(x)}\frac{\partial}{\partial x}f(x,t)dt $$
Thus, $\frac{d}{dx}(\int_x^0 \frac{\cos(xt)}{t} dt)=-\frac{\cos(x^2)}{x}+\int_0^x \sin(xt)dt=-\frac{\cos(x^2)}{x}-\frac{\cos(x^2)}{x}+\frac{1}{x}=\frac{1}{x}(1-2\cos(x^2))$
Edit 2: I'm not so sure that my above method is correct anymore.

As mentioned in the comments, this integral does not converge for any $x \neq 0$. This is due to the fact that
$$ \int_0^{a} \frac{1}{x} dx$$
does not converge for any $a$. So it does not make sense to talk about the derivative of the integral in your question.
We can note that if the original integral was
$$ \int_x^{1} \frac{\cos tx}{t} dt,$$
then this has a derivative that makes sense for all $x > 0$. Further, the derivative is exactly what you think the derivative should be, as indicated by the work in the OP.
