  Weighted Poincar\'e-type and related inequalities provide upper bounds of the
variance of functions. Their application in sensitivity analysis allows for
quickly identifying the active inputs. Although the efficiency in prioritizing
inputs depends on the upper bounds, the latter can be big, and therefore
useless in practice. In this paper, an optimal weighted Poincar\'e-type
inequality and gradient-based expression of the variance (integral equality)
are studied for a wide class of probability measures. For a function $f :
\mathbb{R} \to \mathbb{R}^n$, we show that $${\rm Var}_\mu(f) = \int_{\Omega
\times \Omega} \nabla f (x) \nabla f (x')^T \frac{F(\min(x,\, x') -
F(x)F(x')}{\rho(x) \rho(x')} \, d\mu(x) d\mu(x')\, ,$$ and $${\rm Var}_\mu(f)
\preceq \frac{1}{2}\int_\Omega \nabla f(x) \nabla f(x)^T \frac{F(x)
(1-F(x))}{[\rho(x)]^2}\, d\mu(x) \, ,$$ with ${\rm Var}_\mu(f) = \int_\Omega
ff^T\, d\mu -\int_\Omega f \, d\mu \int_\Omega f^T\, d\mu$, $F$ and $\rho$ the
distribution and the density functions, respectively. These results are
generalized to cope with multivariate functions by making use of cross-partial
derivatives, and they allow for proposing a new proxy-measure for multivariate
sensitivity analysis, including Sobol' indices. Finally, the analytical and
numerical tests show the relevance of our proxy-measure for identifying
important inputs by improving the upper bounds from Poincar\'e inequalities.
