# Changing from cartesian to polar

I want to change the following integral to the polar form $$\int_{y=0}^a \int_y^{\sqrt{1-y^2}}(x^2+y^2) dx dy,\ a>0$$ in Mathematica.I would be highly obliged for any help

• "Use IntegrateChangeVariables! " <- Sadly this isn't an answer to your question. (Your example is an extension of 3rd example of IntegrateChangeVariables, though. Do you intentionally ask this after reading the document of IntegrateChangeVariables?) BTW, I think the integral can be transformed to polar coordinates only if $-1\leq a\leq1$? Aug 25, 2022 at 5:56

• The formula is wrong. Sqrt[1 - y^2] should be Sqrt[a^2 - y^2] Mathematica can handle such integration directly.
Clear[reg];
reg = ImplicitRegion[{0 <= y <= a, y <= x <= Sqrt[a^2 - y^2]}, {x, y}];
Integrate[x^2 + y^2, {x, y} ∈ reg, Assumptions -> a > 0]


• For the corrected integral, we can also use IntegrateChangeVariables.
intCartesian =
Inactive[Integrate][x^2 + y^2, {y, 0, a}, {x, y, Sqrt[a^2 - y^2]}]
intPolar =
IntegrateChangeVariables[intCartesian, {r, θ},
"Cartesian" -> "Polar"]
Activate[intPolar]


## Appendix

When a is less equal to 1/Sqrt[2], for example a=1/2, the questioner's region is

reg = ImplicitRegion[{0 <= y <= 1/2, y <= x <= Sqrt[1 - y^2]}, {x, y}];
% // Region


It is not a regular sector,so it it hardly to use polar coordinate to calculate such integration(but cartesian coordinate work),that is why the IntegrateChangeVariables cann't work for this case.

• What if the formula is not wrong and OP just want to study that integral :) ? Aug 25, 2022 at 6:21
• By the way : Mathematica is able to solve the "wrong" integral analytically. Aug 25, 2022 at 6:23
• @xzczd It seems that IntegrateChangeVariables not easy to do with the parametric a. Aug 25, 2022 at 6:24
• @UlrichNeumann Yes, I have test the wrong integral, for example ,when a=1/2, it is impossible calculate the integral by change the variable using polar coordinate since the region in not a regular sector. Aug 25, 2022 at 6:33
• @cvgmt I tried (Mathematica v12.2) Integrate[(x^2 + y^2), {y, 0, a}, {x, y, Sqrt[1 - y^2]}] which evaluates to 1/12 (a Sqrt[1 - a^2] + 2 a^3 (-2 a + Sqrt[1 - a^2]) + 3 ArcSin[a]) for -1<a<1 Aug 25, 2022 at 6:39