Let us consider the Fokker-Planck equation $$ \partial_tu_t = \Delta u_t + \nabla \cdot(xu_t) $$ for $u\in C((0,T);P_2(\mathbb{R}^n))$ ($P_2$ being the space of probability measures with finite second moment) to be understood in distributional sense as \begin{align}\label{x} \int_0^T\int_{\mathbb{R}^n}\partial_t\varphi(x,t)d u_t(x)d t = \int_0^T\int_{\mathbb{R}^n}\left(\Delta_x\varphi(x,t)+\nabla_x\varphi(x,t)\cdot x\right)d u_t(x)d t\end{align} for every $\varphi\in C_c^\infty(\mathbb{R}^n\times(0,T))$.
I am reading an article in which it is then used that $$ \frac{d}{dt} \int \lvert x\rvert^2du_t = 2n - 2\int\lvert x\rvert^2 du_t.$$ I really struggle to understand this. First, why are the integrals well defined given that $x\mapsto \lvert x\rvert^2$ does not qualify as a test function? Secondly, even if I knew that all terms exist, I still have no clue how to check the equation.
(My useless own thoughts on this: I noticed that if one "forgets" to integrate wrt. $t$ in the formula with the $\varphi$ then the right hand side is $ 2n - 2\int\lvert x\rvert^2 du_t = \Delta u_t(\lvert x\rvert^2) - \nabla \cdot(xu_t)(\lvert x\rvert^2) $ but seems to lead nowhere) Any help would be greatly appreciated!
The integral is well defined because we assumed that our measures of interest have finite second moment, so $$ \varphi \rightarrow \int_{[0,T]\times\mathbb{R}^n} \varphi(x)|x|^2\,du_t $$ is always finite for any test function, so it is a distribution, thus we can take a weak derivative of it.
As for equality we use the Fokker-Planck equation: $$ \frac{d}{dt}\int |x|^2\,du_t = \int |x|^2\,d(\Delta_x u_t) + \int |x|^2\,d(\nabla \cdot xu_t) $$ Then integrating by parts we arrive at $$ \int \Delta|x|^2\,du_t - \int (\nabla|x|^2)\cdot x\,du_t = \int 2n\,du_t - \int 2x\cdot x\,du_t = 2n - 2\int |x|^2\,du_t, $$ since these are probability measures.
Hope I helped.