calculate the derivative using fundamental theorem of calculus This is a GRE prep question:
What's the derivative of $f(x)=\int_x^0 \frac{\cos xt}{t}\mathrm{d}t$?
The answer is $\frac{1}{x}[1-2\cos x^2]$. I guess this has something to do with the first fundamental theorem of calculus but I'm not sure how to use that to solve this problem.
Thanks in advance.
 A: First Foundamental Theorem of Calculus :
$$\frac{d}{dx}\int_{{\alpha(x)}}^{{\beta(x)}}f(x,y)\,dy=\int_{{\alpha(x)}}^{{%
\beta(x)}}\frac{\partial f(x,y)}{\partial x}\,dy+\frac{d\beta(x)}{dx}f(x,\beta%
(x))-\frac{d\alpha(x)}{dx}f(x,\alpha(x))\, $$
where :
$$\alpha(x)=0, \beta(x)=x, f(x,y)=\frac{\cos xy}{y}$$
A: Note that not only the domain of integration but also the integrand depend on $x$. Let's (for a moment) write $F(x) = \int_x^0 f(x, t)\,dt = -\int_0^x f(x,t)\,dt$ for your integral. To handle the "double" $x$-dependence, we write $F$ as the composition of $\Delta\colon \mathbb R \to \mathbb R^2$, $x\mapsto (x,x)$ and $\Phi\colon \mathbb R^2 \to \mathbb R$, $(x_1, x_2) \mapsto -\int_0^{x_1} f(x_2, t)\, dt$. We have $F = \Phi \circ \Delta$, hence 
$$ F'(x) = \nabla \Phi \bigl(\Delta(x)\bigr) \cdot \Delta'(x) $$
by the chain rule. Now $\Delta'(x) = (1,1)$, and 
\begin{align*}
  \partial_1\Phi(x_1, x_2) &= -f(x_2, x_1)\\
  \partial_2\Phi(x_1, x_2) &= -\int_0^{x_1} \partial_{x_2} f(x_2, t)\, dt 
\end{align*}
(for the first derivative we used the fundamental theorem). Plugin everything together, we obtain 
$$ F'(x) = -f(x,x) - \int_0^x \partial_x f(x,t)\, dt $$
A: The integral does not exist,  consequently it is not differentiable. 
The integral does not exist, because for each $x$ ($x>0$, the case of negative
$x$ is dealt with similarly) there is some $\varepsilon > 0$ such that 
$\cos(xt)> 1/2$ for all $t$ in the $t$-range $0\le t \le \varepsilon$. If one splits the integral $\int_x^0 =
\int_\varepsilon^0 + \int_x^\varepsilon$, then the second integral exists,
because the integrand is continuous in the $t$-range $\varepsilon \le t\le x $. The first is by definition
$\lim_{\eta\rightarrow 0+}\int_\varepsilon^\eta$ and larger than $(-\ln \eta + \ln \varepsilon)/2$. So the limit does not exist.
