If $p>1$, $fgeq 0$, and $$ex F(x)=int_0^x f(t) d t, eex$$ then $$eelabel{Hardy:0 to x} int_0^infty sex{frac{F}{x}}^p d x leq sex{frac{p}{p-1}}^p int_0^infty f^p d x. eee$$
Proof: $$eex ea int_0^infty sex{frac{F}{x}}^p d x &=frac{1}{1-p} int_0^infty F^p d x^{1-p}\ &=-frac{1}{1-p}int_0^infty pF^{p-1} fcdot x^{1-p} d x\ &=frac{p}{p-1}int_0^infty sex{frac{F}{x}}^{p-1}cdot f d x\ &leq frac{p}{p-1}sex{int_0^infty sex{frac{F}{x}}^p d x}^frac{p-1}{p} sex{int_0^infty f^p d x}^frac{1}{p}. eea eeex$$
If $p>1$, $fgeq 0$, and $$ex F(x)=int_x^infty f(t) d t, eex$$ then $$eelabel{Hardy:x to infty} int_0^infty sex{frac{F}{x}}^p d x leq sex{frac{p}{p-1}}^p int_0^infty f^p d x. eee$$
Proof: $$eex ea int_0^infty sex{frac{F}{x}}^p d x &=frac{1}{1-p} int_0^infty F^p d (x^{1-p})\ &=-frac{1}{1-p}int_0^infty pF^{p-1} fcdot x^{1-p} d x\ &=frac{p}{p-1}int_0^infty sex{frac{F}{x}}^{p-1}cdot f d x\ &leq frac{p}{p-1}sex{int_0^infty sex{frac{F}{x}}^p d x}^frac{p-1}{p} sex{int_0^infty f^p d x}^frac{1}{p}. eea eeex$$
If $p>1$, $r eq 1$, $fgeq 0$, and $$ex F(x)=sedd{a{ll} int_0^x f(t) d t,&r>1,\ int_x^infty f(t) d t,&r<1, ea} eex$$ then $$eelabel{Hardy:general} int_0^infty x^{-r}F^p d x leq sex{frac{p}{|r-1|}}^p int_0^infty x^{-r} (xf)^p d x. eee$$
Proof: If $r>1$, then $$eex ea int_0^infty x^{-r}F^p d x&=frac{1}{1-r}int_0^infty F^p d (x^{1-r})\ &=-frac{1}{1-r}int_0^infty pF^{p-1} fcdot x^{1-r} d x\ &=frac{p}{r-1}int_0^infty (x^{-r}F^p)^frac{p-1}{p} cdotsez{x^{-r}(xf)^p}^frac{1}{p} d x\ &leq frac{p}{r-1} sex{int_0^infty x^{-r}F^p d x}^frac{p-1}{p} sex{int_0^infty (xf)^p d x}^frac{1}{p}. eea eeex$$
Remark: All the Hardy type inequality requires the non-negativity of the function $f$, so that in the estimates above, the right-hand side could be absorbed into the left-hand side.