having trouble with limit of integral How do I solve the following?
$$\lim_{x\to 0} \int_0^1 \cos\left(\frac{1}{xt}\right)\, dt$$
 A: If it's defined, it must be equal to
$$\lim_{x\to 0}\;\lim_{a\to 0} \int_a^1 \cos\left(\frac{1}{xt}\right)\, \mathrm{d}t\;.$$
Now the integral is well-defined, and you can substitute $u = 1 / (xt)$, yielding
$$\lim_{x\to 0}\;\lim_{a\to 0} \frac{1}{x}\int_{1/x}^{1/(ax)} \frac{\cos u}{u^2}\, \mathrm{d}u\;.$$
Then integration by parts leads to
$$\lim_{x\to 0}\;\lim_{a\to 0} \frac{1}{x}\left(\left[\frac{\sin  u}{u^2}\right]_{1/x}^{1/(ax)}+2\int_{1/x}^{1/(ax)} \frac{\sin u}{u^3}\, \mathrm{d}u\right)\;.$$
Now you can bound the absolute value of the integral by taking the absolute value of the integrand and dropping the sine, and both terms vanish in the limit(s).
A: Here's another take.  Since $\cos \left(\frac{1}{xt}\right)$ is an even function of $x$, we can take the limit from the right or from the left, and the result is the same.  So assume $x > 0$.  Then apply the $u = 1/(xt)$ substitution as in joriki's answer, followed by integration by parts in the opposite direction from joriki's answer.  Rewriting the result in terms of the sine integral produces the output from Wolfram Alpha mentioned by Eivind and Sivaram: 
$$ \lim_{x \to 0} \left(\frac{1}{x} \int_0^{1/x} \frac{\sin u}{u} du  - \frac{\pi}{2x} + \cos \left(\frac{1}{x}\right)\right).$$
Now, apply the following known series expansion for the sine integral $\int_0^x \frac{\sin u}{u} du$  (valid for large values of $x$):
$$\int_0^x \frac{\sin u}{u} du = \frac{\pi}{2} -\frac{\cos x}{x} \left(1 - \frac{2!}{x^2} + \frac{4!}{x^4} \pm \cdots \right) - \frac{\sin x}{x} \left(\frac{1}{x} - \frac{3!}{x^3} \pm \cdots \right).$$ 
After simplifying, we are left with 
$$\lim_{x \to 0} \left(-\cos \left(\frac{1}{x}\right) \left(- 2! x^2 + 4! x^4 \pm \cdots \right) - \sin\left(\frac{1}{x}\right) \left(x - 3! x^3 \pm \cdots \right) \right).$$
Since $\cos \left(\frac{1}{x}\right)$ and $\sin \left(\frac{1}{x}\right)$ are both bounded by $-1$ and $1$, the limit is $0$.
In addition, we can see that the dominant term in the limit is $- x\sin\left(\frac{1}{x}\right)$, which is clearly bounded by $|x|$, as conjectured by Sivaram in the comments.
