These are what is called improper integrals. You integrate them by taking limits of finite integrals. For your second example we would let
$ \int_{[1,\infty)}\frac{12}{x}\, dx=\lim_{b\to\infty}\int_1^b\frac{12}{x}\,dx. $
If you carryout the integration, you are left with
$ \lim_{b\to\infty}(\ln(b)-\ln(1). $
Since that limit does not exist, we say that it doesn't converge. If you try the same thing with $f(x)=\frac{12}{x^2}$, you will get a limit that does exist and we would call the integral convergent. To deal with integrals over open intervals, we would take limits again:
$ \int_{(0,1]}f(x)\,dx = \lim_{a\to 0}\int_a^1f(x)\,dx. $