On the distribution of a quadratic form