  We construct families of optimal Hardy-weights for a subcritical linear
second-order elliptic operator using a one-dimensional reduction. More
precisely, we first characterise all optimal Hardy-weights with respect to
one-dimensional subcritical Sturm-Liouville operators on a given interval, and
then apply this result to obtain families of optimal Hardy inequalities for
general linear second-order elliptic operators in higher dimensions. As an
application, we prove a new Rellich inequality.
