# Integrating wrt to same parameter twice

I was reading an answer to another question and I saw something like:

$$\int \int f(\theta) d\theta d\theta = \int f(\theta) d\theta$$

My calculus ia a bit rusty but can someone tell me the intuitive reason why we can drop one of the integrals.

• Err.. in general you can't. Perhaps it's not you who's the rusty one. ;) – David H Jun 15 '15 at 6:15
• Can you link the other question? – Adam Hughes Jun 15 '15 at 6:19
• Isn't the first integral always $0$? – GPerez Jun 15 '15 at 6:30
• Ok, I updated the question with the link. – user42140 Jun 15 '15 at 6:40
• The trick is that $\theta$ isn't $\theta$; it's using the same letter to refer to two different things, to confusing effect. – user14972 Jun 15 '15 at 8:42

I think I see reasoning behind the answer. I quote it here:

\begin{align*} \int \pi \left( \theta \mid y\right) d\theta&=\int\frac{f\left( y\mid\theta \right) \pi \left(\theta \right) }{\int f\left( y\mid\theta \right) \pi \left(\theta \right)d\theta}d\theta\\ &=\frac{\int f\left( y\mid\theta \right) \pi \left(\theta \right) d\theta}{\int f\left( y\mid\theta \right) \pi \left(\theta \right)d\theta}\\ &=1, \end{align*}

The answerer simply uses that the denominator of the original integrand is nothing more than a number. It's hard to tell because they look like "indefinite integrals" but from the context it's clear that they are definite integrals, most likely over $\Bbb R$. Write, for example $$I := \int_{\Bbb R} f(y\mid\theta)\pi(\theta)\,d\theta$$ This is a real number! So, $$\int_{\Bbb R}\frac{f\left( y\mid\theta \right) \pi \left(\theta \right) }{\int_{\Bbb R} f\left( y\mid\theta \right) \pi \left(\theta \right)d\theta}\,d\theta = \int_{\Bbb R}\frac{f\left( y\mid\theta \right) \pi \left(\theta \right) }{I}\,d\theta = \frac 1I\int_{\Bbb R} f(y\mid\theta)\pi(\theta)\,d\theta = 1$$

No integral sign is being dropped as you say, just factoring out of constants.

• Ah ok. That makes sense. Thank you for the answer. I got confused when he said "where we can "take out" the integral in the denominator because θ had already been integrated out there." – user42140 Jun 15 '15 at 7:27

if the limits of integration were from 0 up to 1, then the equality would be true.

• but this is not always true. Pick f identicaly 1 and calculate with the same limits of integration. – Micael Jun 15 '15 at 6:22
• Do you mean that $\int_0^1g(x)dt = g(x)$? – Surb Jun 15 '15 at 7:14