  We consider finite element approximations to the optimal constant for the
Hardy inequality with exponent $p=2$ in bounded domains of dimension $n=1$ or
$n \geq 3$. For finite element spaces of piecewise linear and continuous
functions on a mesh of size $h$, we prove that the approximate Hardy constant
converges to the optimal Hardy constant at a rate proportional to $1/| \log h
|^2$. This result holds in dimension $n=1$, in any dimension $n \geq 3$ if the
domain is the unit ball and the finite element discretization exploits the
rotational symmetry of the problem, and in dimension $n=3$ for general finite
element discretizations of the unit ball. In the first two cases, our estimates
show excellent quantitative agreement with values of the discrete Hardy
constant obtained computationally.
