Shifted Gaussian I am looking for a closed form expression for the following Gaussian integral, shifted by $N$ parameters $b_i$:
$$
\frac{1}{2\pi}\int_{-\infty}^\infty e^{-\frac{1}{2}\sum_{i=1}^N (x-b_i)^2}dx.
$$
The first few $i=1,2,3,\dots$ are easy to compute but I haven’t spotted the pattern yet. Even better than answering the above question would be to give an expression for the more general integral
$$
\frac{1}{2\pi}\int_{-\infty}^\infty e^{-\frac{1}{2}\sum_{i=1}^N a_i(x-b_i)^2}dx
$$
in terms of the parameters $a_i$ $>0$ and $b_i$. Thanks for the help.
 A: $$\sum_{i=1}^N a_i(x-b_i)^2=\left(\sum_{i=1}^N a_i\right)x^2 -2\left(\sum_{i=1}^N a_ib_i\right)x+\left(\sum_{i=1}^N a_i(b_1)^2\right)$$
$$\begin{cases}
A=\sum_{i=1}^N a_i\\
B=\sum_{i=1}^N a_ib_i\\
C=\sum_{i=1}^N a_i(b_1)^2
\end{cases} $$
$$\sum_{i=1}^N a_i(x-b_i)^2=Ax^2-2Bx+C=A\left(x-\frac{B}{A}\right)^2+C-\frac{B^2}{A}
$$
$$
\frac{1}{2\pi}\int_{-\infty}^\infty e^{-\frac{1}{2}\sum_{i=1}^N a_i(x-b_i)^2}dx=\frac{1}{2\pi} e^{-\frac{1}{2}\left(C-\frac{B^2}{A}\right) }\int_{-\infty}^\infty e^{-\frac{1}{2}A\left(x-\frac{B}{A}\right)^2 } dx$$
$\int_{-\infty}^\infty e^{-\frac{1}{2}A\left(x-\frac{B}{A}\right)^2 } dx = \sqrt{\frac{2\pi}{A}}$
$$\frac{1}{2\pi}\int_{-\infty}^\infty e^{-\frac{1}{2}\sum_{i=1}^N a_i(x-b_i)^2}dx=\frac{1}{\sqrt{2\pi A}} e^{-\frac{1}{2}\left(C-\frac{B^2}{A}\right)}$$
$$\boxed{\frac{1}{2\pi}\int_{-\infty}^\infty e^{-\frac{1}{2}\sum_{i=1}^N a_i(x-b_i)^2}dx=\frac{1}{\sqrt{2\pi \sum_{i=1}^N a_i}} e^{-\frac{1}{2}\left(\sum_{i=1}^N a_i(b_1)^2-\frac{\left(\sum_{i=1}^N a_ib_i\right)^2}{\sum_{i=1}^N a_i}\right)}}$$
A: Here is a way to compute the last integral: notice that if $s_1:=\sum_{i=1}^Na_i> 0$,
$$
\sum_{i=1}^N a_i(x-b_i)^2 =s_1\left(x^2-2\frac{\sum_{i=1}^Na_ib_i}{s_1}x+\frac{\sum_{i=1}^Na_ib_i^2}{s_1}\right).
$$
Letting $s_2:=\sum_{i=1}^Na_ib_i$ and $s_3:=\sum_{i=1}^Na_ib_i^2$, the last expression can be written as
$$
\sum_{i=1}^N a_i(x-b_i)^2 =s_1\left(\left(x-\frac{s_2}{s_1}\right)^2+
\frac{s_3}{s_1}-\frac{s_2^2}{s_1^2}\right).
$$
Now, we are in position to compute the last integral: do the substitution $t=\sqrt{s_1}\left(x-\frac{s_2}{s_1}\right)$ and put
$\exp\left(-s_1/2\cdot \left(\frac{s_3}{s_1}-\frac{s_2^2}{s_1^2}\right)\right)$ outside the integral.
