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.