If $p>1$, $f\geq 0$, and $$\bex F(x)=\int_0^x f(t)\rd t, \eex$$ then $$\bee\label{Hardy:0 to x} \int_0^\infty \sex{\frac{F}{x}}^p\rd x \leq \sex{\frac{p}{p-1}}^p \int_0^\infty f^p\rd x. \eee$$
Proof: $$\beex \bea \int_0^\infty \sex{\frac{F}{x}}^p\rd x &=\frac{1}{1-p} \int_0^\infty F^p \rd x^{1-p}\\ &=-\frac{1}{1-p}\int_0^\infty pF^{p-1} f\cdot x^{1-p}\rd x\\ &=\frac{p}{p-1}\int_0^\infty \sex{\frac{F}{x}}^{p-1}\cdot f\rd x\\ &\leq \frac{p}{p-1}\sex{\int_0^\infty \sex{\frac{F}{x}}^p\rd x}^\frac{p-1}{p} \sex{\int_0^\infty f^p\rd x}^\frac{1}{p}. \eea \eeex$$
If $p>1$, $f\geq 0$, and $$\bex F(x)=\int_x^\infty f(t)\rd t, \eex$$ then $$\bee\label{Hardy:x to infty} \int_0^\infty \sex{\frac{F}{x}}^p\rd x \leq \sex{\frac{p}{p-1}}^p \int_0^\infty f^p\rd x. \eee$$
Proof: $$\beex \bea \int_0^\infty \sex{\frac{F}{x}}^p\rd x &=\frac{1}{1-p} \int_0^\infty F^p \rd (x^{1-p})\\ &=-\frac{1}{1-p}\int_0^\infty pF^{p-1} f\cdot x^{1-p}\rd x\\ &=\frac{p}{p-1}\int_0^\infty \sex{\frac{F}{x}}^{p-1}\cdot f\rd x\\ &\leq \frac{p}{p-1}\sex{\int_0^\infty \sex{\frac{F}{x}}^p\rd x}^\frac{p-1}{p} \sex{\int_0^\infty f^p\rd x}^\frac{1}{p}. \eea \eeex$$
If $p>1$, $r\neq 1$, $f\geq 0$, and $$\bex F(x)=\sedd{\ba{ll} \int_0^x f(t)\rd t,&r>1,\\ \int_x^\infty f(t)\rd t,&r<1, \ea} \eex$$ then $$\bee\label{Hardy:general} \int_0^\infty x^{-r}F^p\rd x \leq \sex{\frac{p}{|r-1|}}^p \int_0^\infty x^{-r} (xf)^p\rd x. \eee$$
Proof: If $r>1$, then $$\beex \bea \int_0^\infty x^{-r}F^p\rd x&=\frac{1}{1-r}\int_0^\infty F^p\rd (x^{1-r})\\ &=-\frac{1}{1-r}\int_0^\infty pF^{p-1} f\cdot x^{1-r}\rd x\\ &=\frac{p}{r-1}\int_0^\infty (x^{-r}F^p)^\frac{p-1}{p} \cdot\sez{x^{-r}(xf)^p}^\frac{1}{p}\rd x\\ &\leq \frac{p}{r-1} \sex{\int_0^\infty x^{-r}F^p\rd x}^\frac{p-1}{p} \sex{\int_0^\infty (xf)^p\rd 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.