Here's a toy model that is truly linear $$g(x) =\frac{1}{2}\sum_{i=1}^n \Lambda_i x_i^2, $$ where $\Lambda_i$ are i.i.d. $N(0,1)$ then $$x(t)= \Big(e^{-t\Lambda_1} x_1(0),\dotsc, e^{-t\Lambda_n} x_n(0)\Big)$$ so $$U(t):= g(x(t))=\frac{1}{2}\sum_{i=1}^n \Lambda_ie^{-2t\Lambda_i} x_i(0)^2. $$ Denote by $N_T(U)$ the number of zeros of $U(t)$ on the interval $[0,T]$. Denote by $p_{U(t)}(u)$ the probability density of $U(t)$. Then the Kac-Rice formula state that $\newcommand{\bE}{\mathbb{E}}$ $$\bE\big[\; N_T(U)\;\big]=\int_0^T\bE\big[ \; |U'(t)|\;|\; U(t)=0\;\big] p_{U(t)}(0) dt, $$ where $\bE[-|-]$ denotes the conditional expectation. Alternatively we have $\newcommand{\bP}{\mathbb{P}}$ $$ \bE\big[\; N_T(U)\;\big]=\underbrace{\bE\big[\; N_T(U)\;|\;g(U(T))>0\;\big]}_{=0}\bP\big[ g(U(T))>0\big]+\bE\big[\; N_T(U)\;|\;g(U(T))<0\;\big]\bP\big[ g(U(T))<0\big] $$ $$ =\bE\big[\; N_T(U)\;|\;g(U(T))<0\;\big]\bP\big[ g(U(T))<0\big] $$