Let Ω ⊂ ℝ N be a bounded regular domain of ℝ N and 1 < p < ∞. The paper is divided into two main parts. In the first part, we prove the following improved Hardy inequality for convex domains. Namely, for all [Formula: see text], we have [Formula: see text] where d(x) = dist (x, ∂Ω), [Formula: see text] and C is a positive constant depending only on p, N and Ω. The optimality of the exponent of the logarithmic term is also proved. In the second part, we consider the following class of elliptic problem [Formula: see text] where 0 < q ≤ 2* - 1. We investigate the question of existence and nonexistence of positive solutions depending on the range of the exponent q.