Uncertainty relations and quadratic forms