Solving $\int_0^1...\int_0^1 \delta(Q-\sum_{a,b}f_a g_b)\prod_{a,b}[(1-f_a g_b)^{n_{ab}}(f_a g_b)^{m_{ab}}] d f_1 d f_2 d g_1 d g_2$? I derived this multiple integral expression from a probabilistic formulation of a problem related to big data analysis. 
$$\int_0^1...\int_0^1 \delta(Q-\sum_{a,b}f_a g_b)\prod_{a,b}[(1-f_a g_b)^{n_{ab}}(f_a g_b)^{m_{ab}}] d f_1 d f_2  d g_1  d g_2$$
where $\delta()$ is the Dirac delta function, $a\in\{1,2\}$ and $b\in\{1,2\}$ are indexes. $Q$ is a given constant $0\le Q \le 4$. $n_{ab}$ and $m_{ab}$ are given positive integer. $f_a\in[0,1]$, $g_b\in[0,1]$.
I need to evaluate this integral in a software but was unable so far to get an analytical solution.
- Is there and  analytical solution of this integral?
- Otherwise, it is possible to simplify it by some treatable amenable criteria? 
This seems to be a kind of Dirichlet integral, when noticing that the summation of the factors $(1-f_ag_b)+f_ag_b$ is constant.

This is the answer to a drastically simpler problem. If there is only one $a = 1$ and one $b = 1$, $P(a,b) = 1$, and $m=n=1$, we have:
$$\int_0^1 \mathrm df \int_0^1 \mathrm d g \, \delta(E - f g)(1 - f g)(f g) = (E - 1) E \ln E$$
if $0 < E < 1$, and zero otherwise.
