We consider the initial value problem for the filtration equation in an inhomogeneous medium

$p(x)u_t = \Delta u^m, m>1$.

The equation is posed in the whole space $\mathbb R^n$ , $n \geq 2$, for $0 < t < \infty$; $p(x)$ is a positive and bounded function with a certain behaviour at infinity. We
take initial data $u(x,0) = u_0(x) \geq 0$, and prove that this problem is well-posed
in the class of solutions with finite "energy", that is, in the weighted space $L^1_p$, thus completing previous work of several authors on the issue. Indeed, it generates a contraction semigroup.
We also study the asymptotic behaviour of solutions in two space dimensions when $p$ decays like a non-integrable power as $|x| \rightarrow \infty$ : $p(x)$ $|x|^\alpha$ ~ $1$ with
$\alpha \epsilon (0,2)$ (infinite mass medium). We show that the intermediate asymptotics
is given by the unique selfsimilar solution $U_2(x, t; E)$ of the singular problem