Find the double integral of an absolute value trig function

absolute valuedefinite integralsmultivariable-calculus

I have this double integral:

$$\int_{-\pi/2}^{\pi/2} \int_{-\pi/2}^{\pi/2} |\sin(y-x)|dydx$$

And I'm struggling to solve it.

I have reached the answer $4/\pi^2$ however my answer isn't what the textbook says is correct, which is $2\pi$.

Since it's an absolute value I tried this for the new bounds:

$$\int_{-\pi/2}^0 \int_0^{\pi/2} (\sin(y-x))dydx – \int_0^{\pi/2} \int_{-\pi/2}^0 (\sin(y-x))dydx$$
I'm not really sure what to do, I'm pretty sure my new bounds are wrong but I'm not sure. Any kind of help would be appreciated!!

Best Answer

Since $y-x\in[-\pi,\pi]$, $\sin(y-x)\ge0\iff y\ge x$. Therefore, $$\begin{align}I&=\int_{-\pi/2}^{\pi/2}\left(\int_{-\pi/2}^x-\sin(y-x)dy+\int_x^{\pi/2}\sin(y-x)dy\right)dx\\ &=\int_{-\pi/2}^{\pi/2}\left(\left[\cos(y-x)\right]_{-\pi/2}^x+\left[-\cos(y-x)\right]_x^{\pi/2}\right)dx\\ &=\int_{-\pi/2}^{\pi/2}\left(2-\cos(-\pi/2-x)-\cos(\pi/2-x)\right)dx\\&=\int_{-\pi/2}^{\pi/2}2dx\\ &=2\pi. \end{align}$$ This is confirmed by Wolfram Alpha.

Edit: most of the calculations above can be avoided by noticing that for any fixed $x$, the map $y\mapsto|\sin(y-x)|$ has period $\pi$ hence its integral over $[-\pi/2,\pi/2]$ is the same as over $[x,x+\pi]$, namely $\int_0^\pi\sin t\,dt=2$.

Related Question