3

How do I integrate

$$ \int_{-\infty}^\infty\exp\left(\vphantom{\Huge A^{A}}% -\frac{1}{2}\left[n + {1 \over k}\right] \left[\mu-\frac{\varepsilon/k + \sum_{i = 1}^{n}x_i}{n + 1/k}\right]^2 \right) \; d\mu$$

The answer is supposed to be $$\frac{\sqrt{2\pi}}{(n+\frac{1}{k})^{1/2}}$$

It appears this the integral is something of the form

$$\int e^{g(\mu-\frac{h}{g})^2} \; d\mu$$

How do I integrate such a thing? I tried expanding the square part but am not sure I know how to integrate it either

If I try integration by substitution, what do I substitute with? If I do

$$u = \mu-\frac{h}{g}$$

then I still get something like

$$\int e^{gu^2} \, du$$

theres a $u^2$ ... which I dont know how to integrate

UPDATE: Background - full question from my lecture

Its actually a probability question, but the integration part in question is marked with a red arrow ...

enter image description here

enter image description here

Felix Marin
  • 89,464
Jiew Meng
  • 4,593
  • What is $x_i$? We'd need to know that to figure out how to approach this problem better. – 2012ssohn Nov 03 '13 at 01:59
  • I am not sure if its the right explaination, but $x_i$ are various possible values of $x$. Its actually a probability question, so $x_1$ is the 1st value of $x$, $x_2$ is 2nd value for $x$ etc. I will update the OP with the full question as in my lecture – Jiew Meng Nov 03 '13 at 02:04
  • You can use gamma function to evaluate the integral. – Mhenni Benghorbal Nov 03 '13 at 02:14
  • @MhenniBenghorbal, u mean the PDF of gamma distribution ($X \sim \mathcal{G}(\alpha, \lambda)$) being $f(x) = \frac{\lambda^\alpha}{\Gamma (\alpha)} x^{\alpha-1}e^{-\lambda x}$? But what kind of substitution did u use? The 2 expressions look very different? – Jiew Meng Nov 03 '13 at 03:14
  • @MhenniBenghorbal, oh looks like you mean $\Gamma(\alpha) = \int_{0}^\infty t^{\alpha-1}e^{-t}$ but it too looks kind of different? The limits of integration too? – Jiew Meng Nov 03 '13 at 03:18
  • The integral $\large diverges$. See my answer below. We can integrate first over one of the variables ( for example, $\large x_{n}$ ) by shifting it with the sum of the other variables. The remaining integrand is independent of $\large x_{1},\ldots,x_{n - 1}$. – Felix Marin Nov 03 '13 at 20:03
  • @FelixMarin. I really wonder if we all speak about the same problem. In the original post, there is a single variable "mu" and nothing else; all remaining are constants. – Claude Leibovici Nov 14 '13 at 06:58
  • @JiewMeng: What do you find to be missing from, unclear, or unsatisfying in the current answers ? The integral itself is pretty simple and straightforward. What do you think is lacking from the current responses ? – Lucian Nov 14 '13 at 12:29

4 Answers4

2

$\newcommand{\+}{^{\dagger}}% \newcommand{\angles}[1]{\left\langle #1 \right\rangle}% \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}% \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}% \newcommand{\dd}{{\rm d}}% \newcommand{\isdiv}{\,\left.\right\vert\,}% \newcommand{\ds}[1]{\displaystyle{#1}}% \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}% \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}% \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}% \newcommand{\ic}{{\rm i}}% \newcommand{\imp}{\Longrightarrow}% \newcommand{\ket}[1]{\left\vert #1\right\rangle}% \newcommand{\pars}[1]{\left( #1 \right)}% \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}}% \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}% \newcommand{\sech}{\,{\rm sech}}% \newcommand{\sgn}{\,{\rm sgn}}% \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}}% \newcommand{\verts}[1]{\left\vert #1 \right\vert}% \newcommand{\yy}{\Longleftrightarrow}$ $\ds{% {\cal J}_{n} \equiv \int_{-\infty}^\infty\exp\left(\vphantom{\Huge A^{A}}% -\,{1 \over 2}\left[n + {1 \over k}\right] \left[\mu - {\varepsilon/k + \sum_{i = 1}^{n}x_{i} \over n + 1/k}\right]^2 \right)\,\dd\mu}:\ {\large ?}.\qquad\qquad\dd\mu\equiv\dd x_{1}\ldots\dd x_{n}$

\begin{align} {\cal J}_{n} &= \int_{-\infty}^\infty\exp\left(\vphantom{\Huge A^{A}}% -\,{1 \over 2}\left[n + {1 \over k}\right] \left[\mu - {\varepsilon \over nk + 1} - {\sum_{i = 1}^{n}x_{i} \over n + 1/k}\right]^2 \right)\,\dd\mu \\[3mm]& \mbox{With}\quad {x_{i} \over n + 1/k} \to x_{i},\ \mbox{we get} \pars{~\mbox{we assume}\ n + {1 \over k} > 0~}: \\ {\cal J}_{n} &= \pars{n + {1 \over k}}^{n}\int_{-\infty}^\infty\exp\left(\vphantom{\Huge A^{A}}% -\,{1 \over 2}\left[n + {1 \over k}\right] \left[\mu - {\varepsilon \over nk + 1} - \sum_{i = 1}^{n}x_{i}\right]^2 \right)\,\dd\mu \\[3mm]& \mbox{We make the change}\ x_{i} + {1 \over n}\pars{{\varepsilon \over nk + 1} - \mu} \to x_{i}: \\ {\cal J}_{n} &= \pars{n + {1 \over k}}^{n}\int_{-\infty}^\infty\exp\left(\vphantom{\Huge A^{A}}% -\,{1 \over 2}\left[n + {1 \over k}\right] \left[\sum_{i = 1}^{n}x_{i}\right]^2 \right)\,\dd\mu \\[3mm]& \mbox{With}\ \bracks{{1 \over 2}\,\pars{n + {1 \over k}}}^{1/2}x_{i} \to x_{i} \\ {\cal J}_{n} &= 2^{n/2}\pars{n + {1 \over k}}^{n/2}{\cal K}_{n} \quad\mbox{where}\quad {\cal K}_{n} \equiv\int_{-\infty}^\infty\exp\left(\vphantom{\Huge A^{A}}% -\left[\sum_{i = 1}^{n}x_{i}\right]^2\right)\,\dd\mu \end{align}

${\cal K}_{n}$ $\large\tt diverges$ since \begin{align} {\cal K}_{n} &= \int_{-\infty}^{\infty}\dd x_{1}\cdots\int_{-\infty}^{\infty}\dd x_{n - 1} \int_{-\infty}^{\infty}\exp\pars{-\bracks{x_{n} + \sum_{i = 1}^{n - 1}x_{i}}^{2}} \,\dd x_{n} \\[3mm]&= \pars{\int_{-\infty}^{\infty}\exp\pars{-x_{n}^{2}}\dd x_{n}}\ \underbrace{% \int_{-\infty}^{\infty}\dd x_{1}\cdots\int_{-\infty}^{\infty}\dd x_{n - 1}} _{\ds{\Large\to \infty}} \end{align}

Felix Marin
  • 89,464
1

For starters, let us notice that our only integration variable is $\mu$ , and that all other symbols which appear there are independent of it, behaving like simple constants as far as the actual integration process is concerned. Thus our integral becomes $$\int_{-\infty}^\infty e^{-a(x-b)^2}dx=\int_{-\infty}^\infty e^{-at^2}dt=\frac1{\sqrt a}\int_{-\infty}^\infty e^{-u^2}du=\sqrt\frac\pi{a}$$ where a is $\frac{n+\frac1k}2$ , since we know that the value of the Gaussian integral is $\int_{-\infty}^\infty e^{-u^2}du=\sqrt\pi$.

Lucian
  • 48,334
  • 2
  • 83
  • 154
  • How did you get the part $\int e^{-at^2} = \frac{1}{\sqrt{a}} \int e^{-u^2}$ – Jiew Meng Nov 15 '13 at 00:05
  • Ok I got it: using substitution $u=\sqrt{a}t$ – Jiew Meng Nov 15 '13 at 00:08
  • Thanks ! :-) If you're curious about how to determine the value of the Gaussian integral, I've sketched a very brief outline of a proof of sorts here, different than the ones already mentioned in the Wiki article, and based on mathematical induction, Newton's binomial theorem, and a bit of symbolic manipulation. – Lucian Nov 15 '13 at 01:57
0

The antiderivative of Exp[g (mu - h/g)^2] is
Sqrt[Pi] Erfi[Sqrt[g] (-(h/g) + mu)] / 2 Sqrt[g]
where Erfi stands for the imaginary error function erf(iz)/i.
Integrated between - infinity and + infinity, the result is then Sqrt[Pi] / Sqrt[-g]. Replacing g by its definition in your post leads to the expected result

0

As far as I can see, your integrand looks like Exp[-a x^2]. Its antiderivative is (Sqrt[Pi] Erf[Sqrt[a] x]) / (2 Sqrt[a]). Integrated between -inifinity and + infinity, this leads to Sqrt[Pi / a]. This is exactly the answer.

  • I really would like to understand what is going on. My answers are not accepted. OK, then I suppose they are wrong. But what is wrong : the settings of the problem or the answer ... which is what you expect ! – Claude Leibovici Nov 14 '13 at 10:29
  • It would be to your advantage to learn LaTeX and use MathJax in your answers. – Dan Rust Nov 23 '13 at 19:29