Evaluate Integral Using Change of Variables Let $A = \{(x, y)\in \mathbb{R}^2 | x^2-xy+2y^2<1 \}$; define $f: \mathbb{R}^2 \to \mathbb{R}$ by $f(x, y) = xy$.
Express the integral
$$\int_A f$$
as an integral over the unit ball $B = \{(x, y)\in \mathbb{R}^2 | x^2+y^2<1 \}$.
Someone gave a solution here but it seems to be wrong.
My attempt:
Observe that $x^2-xy+2y^2=(x-\frac{1}{2}y)^2+(\frac{\sqrt{7}}{2}y)^2$.
Let $B^\ast = \{(r, \theta) | 0< r < 1, 0 < \theta < 2\pi\}$.
Let $A^\ast = \{(x, y)\in \mathbb{R}^2 | x^2-xy+2y^2<1$, and $x<0$ if $y=0\}$.
Then the function
$$g(r, \theta) = (r\cos\theta+\frac{1}{\sqrt{7}}r\sin\theta, \frac{2}{\sqrt{7}}r\sin\theta)$$
carries $B^\ast$ in a one-to-one fasion onto $A-\{(0, 0)\}$.
Now we obtain that
\begin{align*}
\text{det} Dg & = 
\begin{vmatrix}\cos\theta+\frac{1}{\sqrt{7}}\sin\theta & -r\sin\theta+\frac{1}{\sqrt{7}}r\cos\theta \\ \frac{2}{\sqrt{7}}\sin\theta & \frac{2}{\sqrt{7}}r\cos\theta \\ \end{vmatrix} \\
& = \frac{2}{\sqrt{7}}r \\
& > 0
\end{align*}
if $(r, \theta)\in B^\ast$.
Since the non-negative $x$-axis has measure zero, using the formula of change of variables, we have that
\begin{align*}
\int_A f 
& = \int_{A^\ast} f \\
& = \int_{B^\ast} f \circ g \cdot |\text{det} Dg| \\
& = \int_0^{2\pi} \int_0^1 \Big((r\cos\theta+\frac{1}{\sqrt{7}}r\sin\theta)\frac{2}{\sqrt{7}}r\sin\theta\frac{2}{\sqrt{7}}r \Big) drd\theta \\
& = \frac{2}{7}\int_0^{2\pi} \int_0^1 (2\cos\theta\sin\theta+\frac{2}{\sqrt{7}}\sin^2 \theta)r^3 drd\theta \\
& = \frac{2}{7}\int_0^{2\pi} \int_0^1 \Big( \sin2\theta+\frac{1}{\sqrt{7}}(1-\cos2\theta) \Big)r^3 drd\theta \\
& = \frac{2}{7}\int_0^{2\pi} \int_0^1 \Big( \sin2\theta-\frac{1}{\sqrt{7}}\cos2\theta+\frac{1}{\sqrt{7}} \Big)r^3 drd\theta \\
& = \frac{2}{7}\int_0^{2\pi} \Big[ \frac{1}{4}\Big( \sin2\theta-\frac{1}{\sqrt{7}}\cos2\theta+\frac{1}{\sqrt{7}} \Big)r^4 \Big]_{r=0}^{r=1} d\theta \\
& = \frac{2}{7}\int_0^{2\pi} \frac{1}{4}\Big( \sin2\theta-\frac{1}{\sqrt{7}}\cos2\theta+\frac{1}{\sqrt{7}} \Big) d\theta \\
& = \frac{1}{14} \Big[ -\frac{1}{2}\cos2\theta-\frac{1}{2\sqrt{7}}\sin2\theta+\frac{1}{\sqrt{7}}\theta \Big]_{\theta=0}^{\theta=2\pi} \\
& = \frac{\pi}{7\sqrt{7}}
\end{align*}
Am I making any mistake? Any help or suggestion is appreciated.
 A: Looks reasonable to me. As a check on your computations, here’s a solution using an approach similar to Ron Gordon’s from the original question.  
Examine the matrix $Q$ associated with the quadratic form $x^2-xy+2y^2$: $$
Q = \pmatrix{1&-\frac12\\-\frac12&2}.
$$ $\det Q>0$ and $\operatorname{tr}Q>0$, so the eigenvalues are positive, which means that we have an ellipse centered on the origin and rotated through some angle $\phi$. Define the pullback $\beta:(\rho,\theta)\mapsto(x,y)$ by $$\begin{align}
\beta^*x &= \rho\,(a\cos\theta\cos\phi-b\sin\theta\sin\phi) \\
\beta^*y &= \rho\,(a\cos\theta\sin\phi+b\sin\theta\cos\phi),
\end{align}$$ where $a$ and $b$ are the half-axis lengths of the ellipse. (This is the polar equation of the ellipse multiplied by $\rho$, which can easily be derived by scaling and rotating the unit circle.) For this pullback, we also have $$\det{\partial(\beta^*x,\beta^*y)\over\partial(\rho,\theta)}=ab\rho.$$ So, if $C$ is the unit disk, $$\begin{align}
\int_Af\,dA &= \int_C\beta^*(f\,dA) \\
&=ab\int_0^{2\pi}\int_0^1\rho^3(a\cos\theta\cos\phi-b\sin\theta\sin\phi)(a\cos\theta\sin\phi+b\sin\theta\cos\phi)\,d\rho\,d\theta \\
&=\frac{ab}4\int_0^{2\pi}(a\cos\theta\cos\phi-b\sin\theta\sin\phi)(a\cos\theta\sin\phi+b\sin\theta\cos\phi)\,d\theta \\
&=\frac{ab}4\int_0^{2\pi}a^2\cos^2\theta\cos\phi\sin\phi - b^2\sin^2\theta\cos\phi\sin\phi + \cdots\,d\theta \\
&=\frac{\pi ab}4(a^2-b^2)\cos\phi\sin\phi.\tag{*}
\end{align}$$ Note that we can ignore terms that involve odd powers of $\cos\theta$ and $\sin\theta$ since we’re integrating from $0$ to $2\pi$.
To determine $a$, $b$ and $\phi$, go back to the matrix $Q$. If its eigenvalues are $\lambda_1 < \lambda_2$, then $a^2 = 1/\lambda_1$ and $b^2 = 1/\lambda_2$. It’s a bit more difficult to find an exact value for $\phi$ in general, but we don’t really need to since we can get its sine and cosine directly from the normalized eigenvectors (which is why I didn’t combine $\cos\phi\sin\phi$ into $\frac12\sin{2\phi}$). In this case, we have $$
a^2 = {2\over3-\sqrt2}, b^2 = {2\over3+\sqrt2} \\
\cos\phi = {\sqrt{2+\sqrt2}\over2}, \sin\phi = {\sqrt{2-\sqrt2}\over2}.
$$ Plugging these values into (*) and simplifying gives ${\pi\over7\sqrt7}$, which agrees with the value computed in the question above.
