Convert the double integral $\int_{-T/2}^{T/2}\int_{-T/2}^{T/2}g(\alpha-\beta)d\alpha d\beta$ to a single integral with respect to $\tau=\alpha-\beta$ Question
I am self-studying signal processing and ran into the following double integral:
$$\int_{-T/2}^{T/2}\int_{-T/2}^{T/2}g(\alpha-\beta)d\alpha d\beta$$
The YouTube video I am watching says this integral can be converted to a single integral using variable substitution with $\tau=\alpha-\beta$.
$$
\int_{-T/2}^{T/2}\int_{-T/2}^{T/2}g(\alpha-\beta)d\alpha d\beta=T\int_{-T}^T g(\tau)\left(1-\frac{|\tau|}{T}\right)d\tau
$$
but I'm having trouble proving it.
Attempt
Following this question, I tried variable substitution with $\tau=\alpha-\beta$ and $\phi=\alpha+\beta$. Then
\begin{align*}
\alpha&=\tau+\beta\\
\beta&=\alpha-\tau\\
\alpha&=\phi-\beta\\
\beta&=\phi-\alpha
\end{align*}
so the Jacobian is
$$
\frac{\partial (\alpha,\beta)}{\partial (\tau,\phi)}=
\left|\begin{matrix}
1 & -1\\
1 & 1
\end{matrix}\right|=2
$$
If I'm doing this correctly, the new integral would be
$$
\int_{-T}^{T}\int_{-T}^{T}g(\tau)(2)d\tau d\phi
$$
But this doesn't seem to be correct. What is the best way to approach this integral?
 A: This is a great approach. One mistake is in computing the Jacobian: the original variables $\alpha$ and $\beta$ must be written entirely in terms of the new variables $\tau$ and $\phi$ rather than depending on each other. You should find that $\alpha=\frac12(\phi+\tau)$ and $\beta=\frac12(\phi-\tau)$.
The other mistake lies in the endpoints of integration. In any double integral, the outer endpoints denote all possible values of the outer variable ($\phi$ in this case); the inner endpoints denote, for any fixed value of the outer variable ($\phi$), all possible corresponding values of the inner variable ($\tau$ in this case).
In the original integral, the outer variable $\beta$ can take any value between $-\frac T2$ and $\frac T2$; and then the inner variable $\alpha$ can also take any value between $-\frac T2$ and $\frac T2$, independently of the value of the outer variable $\beta$. This independence (which manifests in the fact that $\beta$ does not appear in the expressions for the inner endpoints) reflects the fact that the region of integration is a rectangle with sides parallel to the axes. But that shape, and hence that independence, will not survive most changes of variables.
In the new integral, you're right that $\phi$ can take any value between $-T$ and $T$. But the corresponding values of $\tau$ depend upon the value of $\phi$. (For example, if $\phi=T$, what could $\tau$ possibly be?) That dependance must be reflected in the endpoints of the inner integral.
The new integral can be either $\displaystyle\frac12\int_{-T}^{T}\int_{|\phi|-T}^{T-|\phi|}g(\tau) \,d\tau \,d\phi$ or, if you make the other choice about which is the inner and outer variable, $\displaystyle\frac12\int_{-T}^{T}\int_{|\tau|-T}^{T-|\tau|}g(\tau) \,d\phi \,d\tau$. I encourage you to use this latter form to complete the calculation into the answer you expect.
But, most importantly, I encourage you to really understand how changes of variables affect the endpoints of a multiple integral. This is a common tripping point for people learning multivariable calculus, but it's absolutely crucial to master this detail, because without it virtually every change of variables will yield the wrong answer.
A: With $\tau=\alpha -\beta $, rewrite the integral as
\begin{align}
I=\int_{-T/2}^{T/2}\int_{-T/2}^{T/2}g(\alpha-\beta)\ d\alpha d\beta
= &\int_{-T/2}^{T/2}\bigg(\int_{-T/2-\beta}^{T/2-\beta}g(\tau)\ d\tau \bigg)d\beta\\
\end{align}
Then, integrate $\beta$ by parts
\begin{align}
I= & \ \beta \int_{-T/2-\beta}^{T/2-\beta}g(\tau)\ d\tau \bigg|_{-T/2}^{T/2}
 - \int_{-T/2}^{T/2}\beta \ \bigg(\frac d{d\beta}\int_{-T/2-\beta}^{T/2-\beta}g(\tau)\ d\tau \bigg)d\beta\\
= & \ \frac T2\int_{-T}^{T}g(\tau)\ d\tau 
 +\int_{-T/2}^{T/2}\beta \ g(\overset{\tau = T/2-\beta}{T/2-\beta})\ d\beta-\int_{-T/2}^{T/2}\ \beta \ g(\overset{\tau = -T/2-\beta}{-T/2-\beta}))\  d\beta\\
 = &  \int_{-T}^{T}Tg(\tau)d\tau
 -\int_0^T \tau g(\tau)d\tau+\int_{-T}^0 \tau g(\tau)d\tau\\
=& \int_{-T}^T (T-|\tau|)g(\tau)d\tau
\end{align}
A: $\alpha = \frac{\phi + \tau}{2}$ and $\beta = \frac{\phi - \tau}{2}$
So $$\frac{\mathrm d \left(\alpha, \beta\right)}{\mathrm d \left(\phi, \tau\right)} = \left|\begin{matrix}\frac12 & \frac12\\ -\frac12 & \frac12\end{matrix}\right| = \frac12$$
However since,
$$\phi = \tau + 2\beta,$$ then $$\tau-T\le \phi \le \tau+T.$$
and $$\phi = 2\alpha - \tau,$$ then $$-\tau-T\le \phi \le -\tau+T.$$
\begin{align}
\int_{-\frac T2}^{\frac T2}\int_{-\frac T2}^{\frac T2} g\left(\alpha - \beta\right)\mathrm d \alpha \mathrm d \beta &= \int_{-T}^{T} \int_{-T}^{T} g(\tau)\mathbf 1_{\tau - T\le \phi\le \tau + T} \mathbf 1_{-\tau-T\le \phi \le -\tau+T}\times \frac12 \mathrm d \phi \mathrm d \tau\\
&= \frac12\int_{-T}^{T} g(\tau) \left(\int_{-T}^{T} \mathbf 1_{\tau - T\le \phi\le \tau + T}\mathbf 1_{-\tau-T\le \phi \le -\tau+T}\mathrm d \phi\right)\mathrm d \tau\\
&= \frac12\int_{-T}^0 g(\tau)\left(\int_{-\tau-T}^{\tau + T} \mathrm d\phi\right)\mathrm d \tau + \frac12\int_{0}^T g(\tau)\left(\int_{\tau-T}^{-\tau+T} \mathrm d\phi\right)\mathrm d \tau\\
&= \frac12\int_{-T}^0 g(\tau)\left(2\tau + 2T\right)\mathrm d \tau + \frac12\int_{0}^T g(\tau)\left(2T-2\tau\right)\mathrm d \tau\\
&= \frac12\int_{-T}^0 g(\tau)\left(2T-2\left|\tau\right|\right)\mathrm d \tau + \frac12\int_{0}^T g(\tau)\left(2T-2\left|\tau\right|\right)\mathrm d \tau\\
&= \frac12\int_{-T}^T g(\tau)\left(2T-2\left|\tau\right|\right)\mathrm d \tau\\
&= \frac12 \times 2T\int_{-T}^T g(\tau)\left(1-\frac{\left|\tau\right|}{T}\right)\mathrm d \tau\\
&= T\int_{-T}^T g(\tau)\left(1-\frac{\left|\tau\right|}{T}\right)\mathrm d \tau
\end{align}
