A tricky integration problem Given: $$f(x)=\int_{x}^{0}\frac{\cos(xt)}t\, dt.$$ What is $f'(x)?$

This is an improper integral, as $t$ approaches $0$, the numerator approaches $1$ while the denominator approaches $0$.
You must check that the limit doesn't diverge!
$$
f(x)=\lim_{c\rightarrow 0^{\pm}}\int_x^c\frac{\cos(xt)}{t}dt
$$
where you use $\pm$ on $0$ depending on the sign of $x$.
Therefore, near $0$, you're integrating something like $\int_0^\varepsilon\frac{dt}{t}$.
This, however, diverges, so $f(x)$ diverges.  How do you take a derivative?
