Lubos Motl has already provided a correct answer. This answer uses a different approach in the spirit of perturbation theory with $j$-sources:
$$\begin{align}\int_{\mathbb{R}^n} \! d^nx ~f(x)~&e^{-\frac{1}{2}x^TAx +j^Tx}\cr
~=~~& f\left(\frac{\partial}{\partial j}\right)
\int_{\mathbb{R}^n} \! d^nx ~e^{-\frac{1}{2}x^TAx +j^Tx}\cr
~\stackrel{\begin{matrix}\text{Gauss.}\\ \text{int.}\end{matrix}}{=}&C~ f\left(\frac{\partial}{\partial j}\right)e^{\frac{1}{2}j^TA^{-1}j}\cr
~\stackrel{\text{Taylor}}{=}&\left. C~ e^{\left(\frac{\partial}{\partial j}\right)^T
\frac{\partial}{\partial x}}f(x)\right|_{x=0}e^{\frac{1}{2}j^TA^{-1}j}\cr
~=~~&\left. C~ e^{\left(\frac{\partial}{\partial x}\right)^T
\frac{\partial}{\partial j}}e^{\frac{1}{2}j^TA^{-1}j}f(x)\right|_{x=0}\cr
~\stackrel{\text{Taylor}}{=}&\left. C~e^{\frac{1}{2}\left(j+\frac{\partial}{\partial x}\right)^T
A^{-1} \left(j+\frac{\partial}{\partial x}\right)} f(x) \right|_{x=0},\end{align}\tag{A}$$
where the constant
$$C~:=~\sqrt{\frac{(2\pi)^n}{\det A}},\tag{B}$$
where $A$ is a symmetric $n\times n$ matrix with positive-definite real part ${\rm Re}(A)>0$,
where $f$ is an analytic function, and where we have used the Taylor formula
$$f(a+x)~=~ e^{a^T\frac{\partial}{\partial x}}f(x)\tag{C}$$
twice.
Eq. (A) is OP's eq. (2) with sources $j\equiv B$. To obtain OP's first eq. remove the sources.