Why does $p(x) = \int d\theta \ p(\theta, x) = \delta(x-X)$

117 Views Asked by At

I am reading a probability book and at some point, the following equation comes up:

$$p(x) = \int d\theta \ p(\theta, x) = \delta(x-X) $$

where $\delta$ is the Dirac delta.

Why is this true? I understand the marginalization part over $\theta$ but why is this also equal to $\delta(x-X)$? Isn't the Dirac delta infinity at $x-X$, as opposed to whatever value the density should have?