Below, we interpret divergent integrals as germs of partial integrals at infinity:
$$\int_0^\infty f(x) dx=\operatorname{bigpart} \int_0^\omega f(x) dx$$
where $\operatorname{bigpart}$ means taking finite and infinite parts of $\int_0^\omega f(x) dx$ at $\omega\to\infty$ while throwing away infinitesimal and oscillating (with zero average) parts. The question is, how can we define this operator?
For instance,
$$\int_0^\omega 1 dx=\omega.$$
It is infinite, so our desired result is $\int_0^\infty 1 dx=\omega$. Thus, $\omega$ plays the role of an infinite constant.
$$\int_0^{\omega } \exp (x) \sin (2 x) \, dx=\frac{2}{5}-\frac{2}{5} e^{\omega } (\cos (2 \omega )-\sin (\omega ) \cos (\omega )).$$
Here, $2/5$ is finite part. The term $-\frac{2}{5} e^{\omega } (\cos (2 \omega )-\sin (\omega ) \cos (\omega ))$ is oscillating with zero average, so should be taken to be equal to zero. So, the desired result is $2/5$.
$$\int_0^{\omega } \cos ^2(x) \, dx=\frac{\omega }{2}+\frac{1}{4} \sin (2 \omega ).$$
The part $\frac{1}{4} \sin (2 \omega )$ is oscillating with zero average, so the desired result is the infinite part $\frac{\omega }{2}$.
$$\int_0^{\omega } \exp (\log (x)+x) \, dx=e^{\omega } (\omega -1)+1.$$
Here we have infinite and finite parts, so the desired result should be kept intact: $\int_0^\infty \exp (\log (x)+x) dx=e^{\omega } (\omega -1)+1$.
On the other hand,
$$\int_0^{\omega } \exp (\log (x)-x) \, dx=e^{-\omega } (-\omega -1)+1.$$
The term $e^{-\omega } (-\omega -1)$ is infinitesimal, so we throw it away, and our desired result is $\int_0^{\infty } \exp (\log (x)-x) \, dx=1$.
Is there a way to define such function $\operatorname{bigpart}$ consistently and automatize the process in a CAS system?