# Area of a loop of a curve in polar coordinates

With the curve of equation $r^{n}=a^{n}\cos n\theta$ the area of one of its $n$ loops is $$\frac{a^{2}\sqrt{\pi }}{2}~\frac{\Gamma (\frac{1}{2}+\frac{1}{n})}{\Gamma (\frac{1}{n})}$$

This can be obtained by a calculus excercice by hand. With Mathematica I am unable to arrive at this result, even a numerical solution with given parameters is not entirely satisfactory.

Below is what I arrived at.

You can represent the function with this MMA code, with 3 loops and a long axis of length 1.

With[{n = 3, a = 1
PolarPlot[ Power[a^n  Cos[n x], 1/n], {x, 0, 2 Pi},
MaxRecursion -> 10]] For the general solution and with the help of calculus I coded

Assuming[{n ∈ Integers, a > 0},
Integrate[(Max[0,  Power[a^n   Cos[ n  t], 1/n]])^2, {t, 0,
2 π/n}]]


MMA hangs evaluating this expression, computes forever and I aborted it afer several minutes. My MMA level is 10.2. With 11.0 that I tried it on the Free Wolfram Development platform it is inconclusive as I run out of processor time.
So let's get a numerical solution

leafArea =
With[{a = 1, n = 3},
1/2 Integrate[(Max[0,  Power[a^n   Cos[ n  t], 1/n]])^2, {t, 0,
2 π/n}]]  // FullSimplify


I have a result but I have some doubt. Lets's compare it with the manual solution:

calcArea = ((a^2 Sqrt[Pi])/2   Gamma[1/2 + 1/n]/Gamma[1/n]  ) /. {a ->
1 , n -> 3} // FullSimplify
leafarea == calcarea    (* remains unevaluated why ? *)


But

N[leafArea] == N[calcArea] (* True !*)


What is going on here ? Can I trust the calcArearesult with Gamma expressions to be true ?

So I decided then to make use of the new region functions that came with MMA 10.0 , less calculus from now on

reg = Assuming[{n ∈ Integers, a > 0},
ImplicitRegion[
a Power[Sqrt[x^2 + y^2], n] < Cos[ n ArcTan[x, y]], {x, y}]]
Area[reg] (* Warning message MMA is unable to do it. *)


OK let's try that for a specific case:

region3leaf =
Assuming[{n == 3, a == 1},
ImplicitRegion[
a Power[Sqrt[x^2 + y^2], n] <
Cos[ n ArcTan[x, y]] && (0 < x <= 1), {x, y}]]
RegionPlot[region3leaf, AspectRatio -> Automatic] (* I see no problem with the way I defined the region*) Area[region3leaf]  (*  Warning message MMA is unable to do it. *)


However with

DiscretizeRegion[region3leaf]
Area[%] /  N[calcarea]


I am able at least to get an approaching solution.

As you can see MMA 10.2 not up to the task I submitted unless there is anything wrong in my code. Apart from waiting for future improvements or corrections in future releases can I arrive at the general solution with the existing MMA functions ?

The following returns the result you expect

Assuming[n > 0 && n ∈ Integers,
Block[{r = Cos[n θ]^(1/n)},
FullSimplify[a^2 Integrate[r^2/2, {θ, -Pi/(2 n), Pi/(2 n)}]]]]
(* (a^2 Sqrt[π] Gamma[1/2 + 1/n])/(2 Gamma[1/n]) *)

• You answer gives òne way to the general solution but I still don't know why MMA could neither cope with an integration inspired from the PolarPlot I coded which (unless contradicted) is correct (as the numerical solution is OK) nor cope with the help of new region functions . – Sigis K Sep 14 '16 at 18:01
• @SigisK Looking at your direct attempt to solve the integral, I believe that your integration limits for a single leaf are incorrect: 0, 2Pi/n rather than -Pi/(2n), Pi/(2n). With just this change, V11 returns the answer you expect. Including a Max function generally makes symbolic integrals much harder (and is unnecessary in this case if you choose the integration limits appropriately). Taking the a outside the integral is an obvious simplification - when Mathematica struggles with an integral, it is worth giving it all the help you can. – mikado Sep 14 '16 at 22:24

One way, if symbolically doesn't work is to interpolate:

l = Table[{a, n,
1/2 NIntegrate[(Max[0, Power[a^n Cos[n t], 1/n]])^2, {t, 0,
2 π/n}]}, {a, 0.1, 5, 0.1}, {n, 0.1, 5, 0.1}] // N;
ip = Interpolation[Flatten[l, 1],InterpolationOrder->5];
ip[1, 3]


0.343417