Commutation between Logarithm and Gaussian Integral. I'm calculating a partition function (physics) and I arrive to the following expression:
$$\log \int_{-\infty}^{\infty} \frac{du}{\sqrt{2\pi}} e^{-u^2/2} e^{-nq/2}[2\cosh(\sqrt{q}\,u+m)]^n \qquad(1)$$
My question is, is it possible to rewrite this integral like
$$\int_{-\infty}^{\infty} \frac{du}{\sqrt{2\pi}} e^{-u^2/2} n\log[ e^{-q/2}\cdot2\cosh(\sqrt{q}\,u+m)] \qquad(2)$$
in an exact way or under some approximations, in the practice I'll take the limit $n \to 0$.
If the answer is "yes", then under what conditions can I do this?
 A: Eq.(1) and eq.(2) are not equal.
Probably this complicated integral cannot be expressed on a closed form, but on the form of a still complicated series :

For example :

A: It turned out to be a simple approximation. Considering $n$ small (analytic continuation), we can write
$$x^n = 1+n\log x+ \mathcal O(n^2)$$
Applying this to the argument of the integral (1) we have
$$I:=\log \int_{-\infty}^{\infty} \frac{du}{\sqrt{2\pi}} e^{-u^2/2} e^{-nq/2}[2\cosh(\sqrt{q}\,u+m)]^n \approx -\frac{nq}{2}+\log \int_{-\infty}^{\infty} \frac{du}{\sqrt{2\pi}} e^{-u^2/2} [1+n\log2\cosh(\sqrt{q}\,u+m)]$$
Omitting terms of order $n^2$, or
$$I\approx-\frac{nq}{2}+\log\left(1+n\int_{-\infty}^{\infty}\frac{du}{\sqrt{2\pi}}e^{-u^{2}/2}\log2\cosh(\sqrt{q}\, u+m)\right) $$
And finally using $\log(1+x)\approx x$, for $x$ small, which is the case because $n$ is small, then
$$I\approx-\frac{nq}{2}+n\int_{-\infty}^{\infty}\frac{du}{\sqrt{2\pi}}e^{-u^{2}/2}\log2\cosh(\sqrt{q}\, u+m) $$
So in the limit $n\to 0$ we have
$$\lim_{n\to0}\frac{I}{n}=-\frac{q}{2}+\int_{-\infty}^{\infty}\frac{du}{\sqrt{2\pi}}e^{-u^{2}/2}\log2\cosh(\sqrt{q}\, u+m)$$
Note. Thanks to @JJacquelin and sorry for not specifying that it was needed an approximation.
