TITLE: Double integral over a region
QUESTION [12 upvotes]: Given $f(x,y)=\displaystyle\frac{x^2}{x^2+y^2}$ and $D=\{(x,y) : 0 \leq x \leq 1, x^2 \leq y \leq 2-x^2\}$ i have to solve $\displaystyle\int\displaystyle\int_Df(x,y)dA$.
Here's my try:
(1) Changing variables
$x = \sqrt{v-u}$, $y= v+u$.
(1.1) Since $0 \leq x \leq 1$, then $0 \leq v-u \leq 1 \rightarrow u \leq v \leq 1+u$
(1.2) Since $x^2 \leq y \leq 2-x^2$, then $v-u \leq v+u \leq 2-v+u \rightarrow -u \leq u \rightarrow 0\leq u$ and $v \leq 2-v \rightarrow v \leq 1$
(1.3) It seems that now i should integrate over  $S = \{(u,v) : 0\leq u \leq v \leq 1 \}$ (the upper triangle in $[0,1]\times[0,1]$ ?), so i may as well put $S = \{(u,v) : 0 \leq v \leq 1, 0 \leq u \leq v  \}$.
(2) Alright, what do i need to calculate the integral?
(2.1) First, i should calculate the Jacobian
$ \displaystyle\frac{\partial(x,y)}{\partial(u,v)} = \left| \begin{array}{cc}
\frac{\partial x}{\partial u} & \frac{\partial x}{\partial v} \\
\frac{\partial y}{\partial u} & \frac{\partial y}{\partial v} \\
\end{array} \right| = \left| \begin{array}{cc}
-\frac{1}{2\sqrt{v-u}} & \frac{1}{2\sqrt{v-u}} \\
1 & 1 \\
\end{array} \right| = -\frac{1}{\sqrt{v-u}}$
(2.2) Then i have to solve $\displaystyle\int_0^1\displaystyle\int_0^v \frac{v-u}{(v-u)+(v^2+2uv+u^2)}\bigg(-\frac{1}{\sqrt{v-u}} \bigg)dvdu$
$=-\displaystyle\int_0^1\displaystyle\int_0^v \frac{\sqrt{v-u}}{v^2+v(1+2u) + (u^2-u) }dvdu$
(2.3) Well, here i'm stuck.I've been thinking about taking $z = \sqrt{v-u}$ and then $dz = \displaystyle\frac{1}{2\sqrt{v-u}}dv$ wich means $dv = 2zdz$, this would lead to an integral of the form
$2\displaystyle\int\displaystyle\int \frac{z^2}{z^2+z(1+4u)+ 4u^2 }dvdu = 2\displaystyle\int\displaystyle\int \frac{z^2}{(z+(\frac{1}{2}+2u))^2-2u }dvdu$ and if i put $w = z+(\frac{1}{2}+2u)$ i'll have $2\displaystyle\int\displaystyle\int \frac{(w-\frac{1}{2}-2u)^2}{w^2-2u }dwdu$ but it seems that the last one will lead to some ugly shaped solution and i would have a hard time getting the final answer.
What would be the best way to solve this?

REPLY [3 votes]: $\newcommand{\+}{^{\dagger}}%
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}%
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}%
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}%
 \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}%
 \newcommand{\dd}{{\rm d}}%
 \newcommand{\ds}[1]{\displaystyle{#1}}%
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}%
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}%
 \newcommand{\fermi}{\,{\rm f}}%
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}%
 \newcommand{\half}{{1 \over 2}}%
 \newcommand{\ic}{{\rm i}}%
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}%
 \newcommand{\isdiv}{\,\left.\right\vert\,}%
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}%
 \newcommand{\ol}[1]{\overline{#1}}%
 \newcommand{\pars}[1]{\left( #1 \right)}%
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}%
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}%
 \newcommand{\sech}{\,{\rm sech}}%
 \newcommand{\sgn}{\,{\rm sgn}}%
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}%
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
\begin{align}
&\int_{D}\fermi\pars{x,y}\,\dd x\,\dd y
= \int_{0}^{1}\dd x\,x^{2}
\int_{-\infty}^{\infty}{\Theta\pars{y - x^{2}}\Theta\pars{2 - x^{2} - y}
                        \over x^{2} + y^{2}}\,\dd y
=
\int_{0}^{1}\dd x\,x^{2}\int_{x^{2}}^{2 - x^{2}}{\dd y \over x^{2} + y^{2}}
\\[3mm]&=
\int_{0}^{1}\dd x\,x\int_{x}^{2/x - x}{\dd y \over 1 + y^{2}}
=
\int_{0}^{1}x\bracks{\arctan\pars{{2 \over x} - x} - \arctan\pars{x}}\,\dd x
\\[3mm]&=
\left.\half\,x^{2}\bracks{\arctan\pars{{2 \over x} - x} - \arctan\pars{x}}
\right\vert_{0}^{1}
-
\int_{0}^{1}\half\,x^{2}\bracks{%
{-2/x^{2} - 1 \over \pars{2/x - x}^{2} + 1} - {1 \over x^{2} + 1}}\,\dd x
\\[3mm]&=
\half\int_{0}^{1}\bracks{%
{x^{2}\pars{2 + x^{2}} \over \pars{2 - x^{2}}^{2} + x^{2}} + {x^{2} \over x^{2} + 1}}
\,\dd x
=
\half\int_{0}^{1}\bracks{%
{x^{4} + 2x^{2} \over x^{4} - 3x^{2} + 4} + 1 - {1 \over x^{2} + 1}}
\,\dd x
\\[3mm]&=
\half\int_{0}^{1}\bracks{%
1 + {5x^{2} - 4\over x^{4} - 3x^{2} + 4} + 1 - {1 \over x^{2} + 1}}
\,\dd x = \color{#0000ff}{\large 1 - {\pi \over 8}
+ \half\underbrace{\int_{0}^{1}{5x^{2} - 4 \over x^{4} - 3x^{2} + 4}\,\dd x}
_{\ds{\approx\ -0.653199}}}
\end{align}

The last integral can be easily calculated by using a 'partial fraction technique'.