<s>[INST] Double integral over area bounded by ellipse Evaluate the double integral of $\int \int(x+y)^{2} dxdy$ over the area bounded by the ellipse $(\frac{x}{a})^2+(\frac{y}{b})^2=1$
Please check answer = $\frac{ab\pi}{4}(a^{2}+b^{2})$
 [/INST] Let,
$$x=ar\cos(\theta)$$
$$y=br\sin(\theta)$$
With $\theta \in [0,2\pi]$ and $r \in [0,1]$. Then the Jacobian corresponding to this transformation is $abr$. And we have the double integral,
$$\int_{0}^{2\pi} \int_{0}^{1} (ar\cos(\theta)+br\sin(\theta))^2 ab r dr d\theta$$
$$=ab \int_{0}^{2 \pi} \int_{0}^{1} \left(a^2r^2\cos^2(\theta)+b^2r^2 \sin (\theta)+\frac{ab}{2}r^2 \sin(2\theta) \right) r dr d\theta$$
Noticing that cosine is $2\pi$ periodic so we quickly see we can drop the $\sin(2\theta)$ term then separate the double integral as follows.
$$=ab \int_{0}^{1} r^3 dr \int_{0}^{2\pi} \left(a^2\cos^2(\theta)+b^2\sin^2(\theta) \right) d\theta$$
$$=\frac{ab}{4} \int_{0}^{2\pi} \left(\frac{1}{2}a^2(1+\cos(2\theta)+\frac{1}{2}b^2(1-\cos(2\theta) \right) d\theta$$
By $2\pi$ periodicity of sine we will see we can drop the $\cos(2\theta)$ terms to get,
$$=\frac{ab}{4} \int_{0}^{2\pi} \left(\frac{a^2}{2}+\frac{b^2}{2} \right) d\theta$$
$$=\frac{\pi ab}{4}(a^2+b^2)$$
</s>