Law zero of thermodynamics - delta function My teacher was explaining the law zero of thermodynamics in a very smiliar way that is explained in the Kardar book. But he added an extra step involving the delta function that I didnt understand.
Once you allow the two systems to exchange heat, the total number of microstates is
$$\Omega(E)=\int\Omega_1(E_1)\Omega_2(E_2)\delta(E-E_1-E_2)dE_1dE_2$$
Which I understand because even though the two systems are exchanging energy, the total energy has to be $E=E_1+E_2$; that's why the delta function is used to restrain the energy.
However, the next step I don't understand, my teacher changes $E_2=E-E_1$, in the equation above and states that the delta function is solved and then writes the expression that can be found on Kardar which is,
$$\Omega(E)=\int\Omega_1(E_1)\Omega_2(E-E_1)dE_1$$
I don't understand what propriety of the delta function is being used to make it disappear from one equation to another. Why is it no longer necessary to use the delta function?
 A: It uses the property that
$$\int \mathrm d x\,f(x)\delta(x-a)=f(a).$$
This is called the sifting property.
In this case it becomes
$$\int \mathrm d E_2\,f(E_2)\delta(E_2-(E-E_1))=f(E-E_1).$$
The argument of the delta function misses a minus sign compared to your integral, but a delta function is symmetric, i.e. $\delta(x)=\delta(-x)$.
A more useful way to think about this that the delta forces the equation $E-E_1-E_2=0$ to be true and you can apply this equation to every other function in the integral, as long as you eliminate the variable that you integrate over. A more general formula is
$$\delta(f(x))=\sum_i\frac{\delta(x-x_i)}{|f'(x_i)|}$$
where $x_i$ are all the roots of $f$. See this question for a derivation. As an example
\begin{align}
\int\mathrm d x\, f(x)\delta(r^2-x^2)&=\int\mathrm d x\, f(x)\left(\frac{\delta(x-r)}{|2r|}+\frac{\delta(x+r)}{|-2r|}\right)\\
&=\frac{f(r)}{2r}+\frac{f(-r)}{2r}
\end{align}
In other words: I solve for $r^2-x^2=0$ for $x$ and then apply this to the argument of $f$. And I also divide by any scalings since $\delta(ax)=\frac{1}{|a|}\delta(x)$
A: The required property of the delta function has been explained in AccidentalTaylorExpansion's answer. However, let me note that the answer was already contained in the original expression of this question. You wrote

even though the two systems are exchanging energy, the total energy has to be $E=E_1+E_2$; that's why the delta function is used to restrain the energy

It is enough to understand the consequence of the previous statement to understand the passage from the two formulae. The delta function $\delta(E-E_1-E_2)$ is there to avoid that integration over the two energies ($E_1$ and $E_2$) would include cases where $E \neq E_1+E_2$. This implies that for every value of, say, $E_1$, only the value $\Omega_2(E_2)=\Omega_2(E-E_1)$ is the contribution of the integration over $E_2$ to the integral over $E_1$. In formulae:
$$
\int \Omega_2(E_2)\delta((E-E_1)-E_2) dE_2 = \Omega_2(E-E_1)
$$
Which is the application to your case of the sifting property of the delta function.
However, notice that the final formula's derivation could be based on the constraint $E=E_1+E_2$ without ever introducing delta functions. One has to see that counting the number of states in that condition is equivalent to "sum" (integrate) over all possible microstates of the two subsystems for all possible ways of sharing the total energy $E$ as $E_1$ in one subsystem and $E-E_1$ in the other subsystem.
