Calculate the following integral: double integral over
Calculate the following integral: $$ \iint_{x^2+y^2\leqslant1} \left|\frac{x+y}{\sqrt2}-x^2-y^2\right|dx\,dy. $$
Explanation of Method
In polar coordinates, $\frac{x+y}{\sqrt2}=r\sin\!\left(\theta+\frac\pi4\right)$, so writing $s=\sin\!\left(\theta+\frac\pi4\right)$, the bracketed expression becomes $r(s-r)$. For each fixed $\theta$, this is a simple sign-changing function of $r\in[0,1]$: if $s\leqslant0$ it stays $\leqslant0$ throughout, while if $0<s\leqslant1$ it is positive for $r<s$ and negative for $r>s$. Splitting the $r$-integral accordingly gives a polynomial in $s$, and the identity $g(s)=h(s)+\frac{s^4}{6}$ (where $g$ is the $s>0$ case and $h$ the $s\leqslant0$ case) lets the $\theta$-integral be split into an easy piece plus a $\sin^4$ piece.
- Convert to polar coordinates, writing $s=\sin\!\left(\theta+\frac\pi4\right)$.
- Integrate with respect to $r$, splitting at $r=s$ when $s>0$.
- Integrate the resulting piecewise expression with respect to $\theta$ using $g(s)-h(s)=\frac{s^4}{6}$.
Step 1 · Convert to polar coordinates
With $x=r\cos\theta$, $y=r\sin\theta$: $x+y=r\sqrt2\sin\!\left(\theta+\frac\pi4\right)$, so writing $s=\sin\!\left(\theta+\frac\pi4\right)$:
$$ \frac{x+y}{\sqrt2}-x^2-y^2 = rs-r^2 = r(s-r). $$
$$ I = \int_0^{2\pi}\int_0^1 |rs-r^2|\,r\,dr\,d\theta. $$
Step 2 · Integrate with respect to $r$
If $s\leqslant0$: $rs-r^2\leqslant0$ for all $r\in[0,1]$, so $|rs-r^2|\cdot r = r^3-sr^2$:
$$ h(s) := \int_0^1 (r^3-sr^2)\,dr = \frac14-\frac{s}{3}. $$
If $0<s\leqslant1$: split at $r=s$, where $rs-r^2$ changes sign:
$$ g(s) := \int_0^s(sr^2-r^3)\,dr + \int_s^1(r^3-sr^2)\,dr = \frac{s^4}{6}-\frac s3+\frac14. $$
Note that $g(s)=h(s)+\dfrac{s^4}{6}$.
Step 3 · Integrate with respect to $\theta$
As $\theta$ runs over any full period, $s=\sin\!\left(\theta+\frac\pi4\right)$ also runs over a full period, so:
$$ I = \int_0^{2\pi} h(s)\,d\theta + \int_{s>0} \frac{s^4}{6}\,d\theta = \int_0^{2\pi}\left(\frac14-\frac{s}{3}\right)d\theta + \frac16\int_0^\pi \sin^4\phi\,d\phi, $$
where in the last integral $\phi=\theta+\frac\pi4$ and the region $s>0$ corresponds to exactly one full half-period, $\phi\in(0,\pi)$.
Since $\displaystyle\int_0^{2\pi}\frac14\,d\theta=\frac\pi2$, and $\displaystyle\int_0^{2\pi} s\,d\theta=0$ (a full period of sine), and $\displaystyle\int_0^\pi\sin^4\phi\,d\phi=\frac{3\pi}{8}$ (Wallis' formula):
$$ I = \frac\pi2 - 0 + \frac16\cdot\frac{3\pi}{8} = \frac\pi2+\frac{\pi}{16} = \frac{9\pi}{16}. $$
Additional Notes
- Verified numerically: direct double integration in polar coordinates gives $I\approx1.767146$, matching $\frac{9\pi}{16}\approx1.767146$ to 9 significant figures.
Result
The solution to the integral is: