# Integrating gaussian expectation by parts

The Gaussian expectation is defined as

$$\langle O(z) \rangle_K = \frac{1}{\sqrt{2\pi K}} \int \biggl[\prod_{\mu=1}^{N} dz_{\mu} \biggr] \exp\biggl(-\frac{1}{2} \sum_{ \mu,\nu=1}^{N}K^{\mu\nu}z_{\mu}z_{\nu}\biggr) O(z)$$

The expectation of $$\sigma'' \sigma$$ is given by:

$$\langle \sigma'' \sigma \rangle_K = \frac{1}{\sqrt{2\pi K}} \int_{-\infty}^{\infty} dz \, e^{-\frac{z^{2}}{2K}} \left(\frac{d}{dz}\sigma'\right) \sigma$$

and

$$\frac{1}{\sqrt{2\pi K}} \int_{-\infty}^{\infty} dz \, e^{-\frac{z^{2}}{2K}}\left(\frac{d}{dz}\sigma'\right)\sigma = \frac{1}{K} \langle z\sigma'\sigma \rangle_K - \langle\sigma'\sigma' \rangle_K$$

with $$\sigma$$ is a composite function of $$z$$ and $$K$$ is the variance of distrbution.

I really don't understand the transform of the third formulas, it's said in the book that they use integral by parts to get the final equality. I know this question is kind of similar to my previous post Identity for the single-variable Gaussian expectation but I've got it over my head for the rest of the night so I really want a satisfied solution to this.

Can anyone help me, please. Much appreciated.

Write $$\phi(z) = \frac{1}{\sqrt{2\pi K}} e^{-z^2/2K}$$ for the indicated gaussian density. Then applying the integration by parts formula

$$\int u' v = uv - \int uv'$$

with $$u = \sigma'$$ and $$v = \sigma \phi$$, we get

$$\int \phi \sigma \sigma'' = \phi \sigma \sigma' - \int (\phi' \sigma + \phi \sigma') \sigma'.$$

Assuming that $$\phi(z)\sigma(z)\sigma'(z) \to 0$$ as $$z \to \pm\infty$$, this then gives

\begin{align*} \langle \sigma'' \sigma \rangle_K &= \int_{-\infty}^{\infty} \phi(z)\sigma(z)(\sigma'(z))' \, \mathrm{d}z \\ &= - \int_{-\infty}^{\infty} (\phi'(z) \sigma(z) + \phi(z) \sigma'(z)) \sigma'(z) \, \mathrm{d}z \\ &= -\langle (\phi'/\phi) \sigma\sigma' \rangle_K - \langle \sigma'\sigma \rangle_K. \end{align*}

Now the desired equality will follow by noting that $$\phi'(z)/\phi(z) = -\frac{z}{K}$$.

• Thank you very much, that was neatly done❤️ Commented Aug 15, 2021 at 3:19