Proving that $\int_0^\infty\sin(x)dx=1$ Logically and by method 1 the limit should be undefined, but with some juggling it comes out to be $1$.


*

*Method 1. $\displaystyle \lim_{k\to\infty} \int_0^k \sin(x) \, dx = -\lim_{k\to\infty} (\cos(k)-1) = \text{not defined}$.

*Method 2. Let $I = \int e^{-tx}\sin(x) \, dx$ and $J=\int e^{-tx}\cos(x) \, dx$. Using integration by parts,
\begin{align*}
I &= -e^{-tx}\cos x - tJ, \tag{i} \\
J &= e^{-tx}\sin x + tI \tag{ii}
\end{align*}
from $\text{(i)}$ and $\text{(ii)}$,
$$ I = -e^{-tx} \left[ \frac{\cos x + t\sin x}{1+t^2} \right], \qquad
J = e^{tx}\left[ \frac{\sin x-t\cos x}{1+t^2} \right]. $$
Thus $\int_0^\infty e^{-tx}\sin(x) \, dx = \frac{1}{1+t^2}$. Taking limit $t \to 0$
$$ \lim_{t\to 0}\int_{0}^{\infty} e^{-tx}\sin(x) \, dx
= \int_{0}^{\infty} \sin(x) \, dx
= 1. $$
Is the integral $1$ or undefined?
 A: In your last line what you actually make is 
$$ \lim_{t\to 0}\int_{0}^{\infty} e^{-tx}\sin(x) \, dx
= \int_{0}^{\infty} \lim_{t\rightarrow 0}e^{-tx}\sin(x) \, dx$$
This last step is only allowed if the convergence is uniform. In a sloppy language this means that the "size" of $sin(x)-e^{-tx} sin(x)$ is "independent" of x. Which is not the case, that's why your result is wrong.
A: In your opinion, is it true that
$$\lim_{x\to +\infty}\left(\lim_{t\to 0^+} e^{-tx}\sin(x)\right)=
\lim_{t\to 0^+}\left( \lim_{x\to +\infty}e^{-tx}\sin(x)\right)\quad ?$$
Switching the order of limits could be dangerous... 
See your last line. Are you sure that
$$\lim_{t\to 0^+}\left(\lim_{r\to +\infty}\int_0^r e^{-tx}\sin(x)dx\right)=\lim_{r\to +\infty}\left(\lim_{t\to 0^+}\int_0^r e^{-tx}\sin(x)dx\right)\quad ?$$
A: The phenomenon is related to re-summation methods which is a outside my competences, but here is a go:
The first integral 
  $M(u) = \int_0^u \sin x \; dx = 1 -\cos (u)$ indeed does not converge but you may take a Cesàro mean to get a limiting average value:
 $C(t) =  \frac{1}{t} \int_0^T M(u)\; du \rightarrow 1$, as $t\rightarrow \infty$. Unwinding the double integral involed you have:
$$ C(t) = \int_0^t \left( 1 - \frac{x}{t}\right) \sin(x) \; dx = \int_0^\infty \left[ (1-x/t) {\bf 1}_{[0,t]}(x) \right] \;\sin(x) \; dx$$
The factor $(1-x/t) {\bf 1}_{[0,t]}(x)$ goes weakly to one as $t\rightarrow \infty$.
This is  similar to the second method in which you look at the average of $f(x)=\sin x$ weighted by $e^{-xt}$ which also goes weakly to $1$ as $t\rightarrow 0$. You may certainly make other choices that would give a different limit so one question may be if there is a natural family of weights for which the limiting average is unique? (I don't have an answer).
