Definition of Improper integral Definition 1: We say a function $f$ is integrable on $[0,\infty)$ if $f$ is integrable on $[0,b]$ for all $b<\infty$, and $\lim\limits_{b\rightarrow\infty }\int_0^b f(x)dx <\infty$. Then we call such number as $\int_0^\infty f(x)dx$. Similarly, we can define integrable function $(-\infty, 0]$. Then we say a function $f$ is integrable on $(-\infty, \infty)$ if $f$ is integrable on both $[0,\infty)$ and $(-\infty, 0]$ and $\int_{-\infty}^\infty f(x) dx = \int_{-\infty}^0 f(x) dx + \int_0^\infty f(x)dx$.
I am wondering if the above definition is equivalent as the following:
Definition 2: We say a function $f$ is integrable on $(-\infty, \infty)$ if $f$ is integrable on $[a,b]$ for all $-\infty<a<b<\infty$, and $\lim_{a\rightarrow -\infty} \lim_{b\rightarrow \infty} \int_a^b f(x) dx <\infty$, and we call such number as $\int_{-\infty}^\infty f(x) dx$.
Also, it seems that definition 2 also depends on the order of the limit. I want to confirm if that is the case.
 A: Your definitions are definitely not equivalent, and as you say there is a problem with definition 2 considering that that the order in which you take the limit can affect which functions are integrable according to that definition. Moreover, the rate at which $a$ and $b$ approach $\infty$ will also be important. The point of choosing definition 1 is that when we say that a limit converges, we mean that it converges on whatever fashion we choose to approach the limit. This is not captured in definition 2, because different integrals will converge depending on how you take the limit and you have no way of compensating for this.
The alternative, described briefly by DonAntonio, is often called the Cauchy Principal Value. The Cauchy Principal Value can be defined differently depending on whether one considers integrals that are improper in the sense that the integral limits go to $\infty$ or integrals of functions over singularities. The idea is however always the same, namely to the take limit symmetrically. In the case of integrals of the type $\int_{-\infty}^{\infty} f(x)\, dx$, we define it as follows
$$\lim_{r \to \infty} \int_{-r}^{r} f(x) \, dx$$
If this limit exists, we call it the Cauchy Principal Value and write
$$\mathbf{P} \int_{-\infty}^{\infty} f(x) \, dx = \lim_{r \to \infty} \int_{-r}^{r} f(x) \, dx.$$
This allows you to assign values to integrals that do not converge in the general sense because we choose one concrete way of taking the double limit in your definition 2, namely symmetrically. You can read more about the CPV on Wikipedia (https://en.wikipedia.org/wiki/Cauchy_principal_value).
