  In the present paper we shall study a variational problem relating the
weighted Hardy inequalities with sharp missing terms. As weights we treat
non-doubling functions of the distance to the boundary of bounded domain.
