Let $a,b \in \mathbb R^m$ be fixed (deterministic vectors), and let $w=(w_1,\ldots,w_m)$ be a random vector in $\mathbb R^m$ with iid coordinates from $N(0,1)$. Define the random variable $$ h(w) := w^Tab^Tw = \sum_{i=1}^m\sum_{j=1}^ma_ib_jw_iw_j. $$ Note that $h(w)$ can also be thought of as a random polynomial of degree 2 (or else, is identically equal to zero if $a_i b_j = 0$ for all $i,j$).
Question. Is there an analytic formula for $p:=\mathbb P(h(w) \le 0)$ ?
Solution to special case whenr $a$ and $b$ are parallel
If $b = ra$, for some $r \in \mathbb R$, then $h(w) = rw^Taa^Tw$, and so one computes $$ p = \begin{cases}1,&\mbox{ if }r \le 0 \text{ or }a = 0,\\0,&\mbox{otherwise.}\end{cases} $$
Observations
Using standard formula for moments of quadratic forms, one notes that
- $\mathbb E[h(w;a,b)] = a^Tb$,
- $\mbox{Var}(h(w;a,b)) = (a^Tb)^2$.
We can rewrite the expression as $(w\cdot a)(w\cdot b)$. This is positive when the dot products of $w$ with $a$ and $b$ are both positive or both negative. We can normalize $a$ and $b$ to unit vectors. Next we can assume $w$ lies in the plane of $a$ and $b$, since the Gaussian is spherically symmetric, and the perpendicular component does not contribute to the dot products. Thus we can reduce the problem to $a$, $b$, and $w$ unit vectors in the plane. Then simple geometry shows that if $a$ and $b$ make an angle of $\theta$, the probability of the expression being positive is $1 - \theta/\pi$. Note that for $\theta = 0$ or $\theta=\pi$, this reduces to the case $a = rb$ with $r$ positive or negative respectively.