Given in my homework I have to compute (by hand) ∬ My solution so far: Let f(x,y)=x^2+y^2 and K=\{(x,y)\in\mathbb{R}^2:x^2+y^2\leq 1\}. With the transformation of polar coordinates \varphi:(r,\phi)\mapsto(r\cdot\cos\phi,r\cdot\sin\phi)=(x,y) and the determinant of the Jacobian matrix |\det D_\varphi|=r we can rewrite the set as K=\{(r\cdot\cos\phi,r\cdot\sin\phi):r\in[0,1],\phi\in[0,2\pi]\} and our integrand too as f(x,y)=x^2+y^2=r^2. \iint\limits_K f(x,y)\,\mathrm dx\,\mathrm dy=\int\limits_0^1\int\limits_0^{2\pi}r^2\cdot |\det D_\varphi|\,\mathrm d\phi\,\mathrm dr=2\pi\int\limits_0^1r^3\,\mathrm dr=\left.2\pi\cdot\frac{1}{4}r^4\right|_0^1=\frac{\pi}{2}.
I now want to check the result with a CAS. I am pretty new to Mathematica so I just didn't found any clue on how to enter such an integral for computation. Any help out there?
Answer
In Mathematica:
Integrate[Integrate[x^2 + y^2, {x, -Sqrt[1 - y^2], Sqrt[1 - y^2]}], {y, -1, 1}]
Or, shorter:
Integrate[x^2 + y^2, {y, -1, 1}, {x, -Sqrt[1 - y^2], Sqrt[1 - y^2]}]
The main trick is to calculate the bound on x based on the current value of y, which is what you need to make the integration bounds explicit. Indeed, x_{max}=\sqrt{1-y^2}. This is something you can do in most integral-calculating math software.
You can also define the region implicitly, see this.
For this specific problem, that would give:
Integrate[(x^2 + y^2) Boole[x^2 + y^2 <= 1], {y, -100, 100}, {x, -100, 100}]
Where the "100" bounds are just to limit the computation. However, Mathematica is even smart enough to calculate:
Integrate[(x^2 + y^2) Boole[x^2 + y^2 <= 1], {y, -Infinity,
Infinity}, {x, -Infinity, Infinity}]
Comments
Post a Comment