Edit: I realized this problem might be better solved as 'derivative of integral with variable in bounds and integrand', e.g. this post.
I'm trying to take the derivative of a double integral, and the variable to be differentiated is inside the integral limits, so I use the indicator function to move the variable $a$ to the integrand. The original integral is $$ \frac{d}{da} \int_{-\infty}^{+\infty} \int_{-a-z}^{a-z} b^2 f(b) g(z) db dz. $$ Use the indicator function for the integration limits $b \in [-a-z, a-z]$, the integral becomes $$ \frac{d}{da} \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 1\{ -a \leq b+z \leq a \} f(b) g(z) db dz, $$ where $f,g: \mathbb{R} \to (0, +\infty)$ and their form unknown, and $b^2 f(b) g(z)>0$ for any $(b,z) \in \mathbb{R}^2 \setminus \{(0,0)\} $. What I tried is below, taking derivative of the indicator function inside the integral: \begin{align} \begin{split} &\int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 \frac{d}{da} [ 1\{ a \geq -(b+z) \} \cdot 1\{ b+z \leq a \} ] f(b) g(z) db dz \\ =& \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 \frac{d}{da} [ 1\{ a \geq -(b+z) \} ] \cdot 1\{ b+z \leq a \} f(b) g(z) db dz \\ &+ \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 1\{ a \geq -(b+z) \} \cdot \frac{d}{da} [ 1\{ b+z \leq a \}] f(b) g(z) db dz \\ =& \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 \delta(-(b+z)-a) \cdot 1\{ a \geq b+z \} f(b) g(z) db dz \\ &+ \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 1\{ a \geq -(b+z) \} \cdot \delta((b+z)-a) f(b) g(z) db dz, \end{split} \end{align} and $\delta(\cdot)$ is the dirac measure. So $\delta(-(b+z)-a) =1$ if and only if $-(b+z)-a=0$, if and only if $a = -(b+z)$, which means $1\{ a \geq b+z \} = 1\{ -(b+z) \geq b+z \} = 1\{ b+z\leq0 \}$. Similarly $\delta((b+z)-a) =1$ if and only if $a=b+z$, which means $1\{ a \geq -(b+z) \} = 1\{ b+z \geq -(b+z) \} = 1\{b+z \geq0 \}$. Plug into the integral, get \begin{align} \begin{split} &\int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 1\{ b+z\leq0 \} f(b) g(z) db dz + \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 1\{b+z \geq0 \} f(b) g(z) db dz\\ =& \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} b^2 f(b) g(z) db dz, \end{split} \end{align} which is obviously wrong. I have trouble identifying the mistake. For the derivative of the indicator function, I used this post and $$ \frac{d}{da} 1\{ a \geq b+z \} = \frac{d}{da} [1 - 1\{ a \leq b+z \}] = -(-\delta(a-(b+z))) = \delta(a-(b+z)) = \delta((b+z)-a), $$ and the last equality is because 'symmetry' of dirac measure. Can anyone take a look and point out my mistake? Thank you.