Double integral over a region 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?
 A: $$
\begin{align}
&\int_0^1\int_{x^2}^{2-x^2}\frac{x^2}{x^2+y^2}\,\mathrm{d}y\,\mathrm{d}x\tag{1}\\
&=\int_0^1\int_{x}^{\frac2x-x}\frac{x}{1+y^2}\,\mathrm{d}y\,\mathrm{d}x\tag{2}\\
&=\int_0^1x\left(\arctan\left(\frac2x-x\right)-\arctan(x)\right)\,\mathrm{d}x\tag{3}\\
&=\int_0^1x\arctan\left(\frac{2(1-x^2)}{x(3-x^2)}\right)\,\mathrm{d}x\tag{4}\\
&=\int_0^1\frac{x^2}{2}\frac{\frac{2(3+x^4)}{x^2(3-x^2)^2}}{1+\left(\frac{2(1-x^2)}{x(3-x^2)}\right)^2}\,\mathrm{d}x\tag{5}\\
&=\int_0^1\frac{x^2(3+x^4)}{x^2(3-x^2)^2+4(1-x^2)^2}\,\mathrm{d}x\tag{6}\\
&=\int_0^1\left(1-\frac1{2(1+x^2)}+\frac{5x^2-4}{2(x^4-3x^2+4)}\right)\,\mathrm{d}x\tag{7}\\
&=1-\frac\pi8+\int_0^1\frac14\left(\frac{\sqrt7x-2}{x^2-\sqrt7x+2}-\frac{\sqrt7x+2}{x^2+\sqrt7x+2}\right)\,\mathrm{d}x\tag{8}\\
&=1-\frac\pi8+\int_0^1\frac{\sqrt7}{8}\left(\frac{2x-\sqrt7}{x^2-\sqrt7x+2}-\frac{2x+\sqrt7}{x^2+\sqrt7x+2}\right)\,\mathrm{d}x\\
&+\int_0^1\frac32\left(\frac1{(2x-\sqrt7)^2+1}+\frac1{(2x+\sqrt7)^2+1}\right)\,\mathrm{d}x\tag{9}\\
&=1-\frac\pi8+\frac{\sqrt7}{8}\log\left(\frac{3-\sqrt7}{3+\sqrt7}\right)\\
&+\frac34(\arctan(2-\sqrt7)+\arctan(2+\sqrt7))\tag{10}\\
&=1+\frac\pi{16}+\frac{\sqrt7}{8}\log(8-3\sqrt7)\tag{11}
\end{align}
$$
Justification:
$\ \;(1)$: get limits from the problem
$\ \;(2)$: change variables $y\mapsto xy$
$\ \;(3)$: integrate in $y$
$\ \;(4)$: combine arctans
$\ \;(5)$: integrate by parts
$\ \;(6)$: algebra
$\ \;(7)$: partial fractions
$\ \;(8)$: integrate and partial fractions
$\ \;(9)$: separate into easily integrable pieces
$(10)$: integrate
$(11)$: simplify: $\quad\frac{3-\sqrt7}{3+\sqrt7}=8-3\sqrt7\quad$ and $\quad\arctan(2-\sqrt7)+\arctan(2+\sqrt7)=\frac\pi4$  
A: $\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'.

A: The result differs from what expected by heropup but I cannot see the mistake.
The domain is symmetric with respect to $y=1$. 
$$\iint_{D} f(x,y) dxdy= 2\int_{0}^{1}\int_{x^2}^{1}\frac{1}{1+\frac{y^2}{x^2}}dydx$$
$$= 2\int_{0}^{1} [t \arctan \frac{y}{t}]_{t^2}^{1} dt=2\int_{0}^{1}  t \arctan \frac{1}{t} dt -2\int_{0}^{1} t \arctan t \ dt$$
$$2 \int_{0}^{1}  t \arctan \frac{1}{t} dt= [t^2 \arctan \frac{1}{t} +t -\arctan t]_{0}^{1}= \frac{\pi}{4} - \lim_{t \rightarrow 0^+} t^2 \arctan \frac{1}{t}+ 1 -\frac{\pi}{4}= 1$$
$$2\int_{0}^{1} t \arctan t \ dt= [(1+t^2) \arctan t- t]_{0}^{1}=\frac{\pi}{2}- 1$$
