# Integration taking too long

Mathematica is having issues with the following code:

AreaH = Integrate[Integrate[\[Sqrt](a*Sin[\[Theta]]^2 - J^2*Sin[\[Theta]]^4), {\[Theta], 0, \[Pi]}], {\[Phi], 0, 2*\[Pi]}]
SEn = AreaH/4;
Plot[SEn, {J, 0, 100}]

It is stuck attempting to do the integral and so doesn't output the solution. How can I re-code this to actually make it produce the solutions I want?

• Edit - I simplified it down significantly to just the integral Commented Apr 29, 2021 at 18:51
• If the integrand does not depend on $\phi$ this is a line-integral. = 2 \[Pi] Integrate[\[Sqrt](a*Sin[\[Theta]]^2 - J^2*Sin[\[Theta]]^4), {\[Theta], 0, \[Pi]}]
– A.G.
Commented Apr 29, 2021 at 22:10

If a and J are real and positive, then this gives a partial result:

Integrate[√(a*Sin[θ]^2 - J^2*Sin[θ]^4),
{θ, 0, π}, {ϕ, 0, 2*π},
Assumptions -> a > 0 && J > 0]
(*
ConditionalExpression[
2*Pi*(Sqrt[a] + (a/J - J)*
ArcCosh[Sqrt[a/(a - J^2)]]), a > J^2]
*)
• I also did get this eventually, but only after my Notebook spent a solid 5 mins computing it. Why is this so slow? Commented Apr 29, 2021 at 19:02
• @Sophia It takes my MacBook Pro only 13 sec. It takes some time to analyze singularities that depend on parameters (on a and J in this case). I'm not sure what yours takes so much longer than mine. It could be a version difference. I'm using V12.2. Commented Apr 29, 2021 at 19:13
• This is two seconds faster: Integrate[\[Sqrt](a*Sin[\[Theta]]^2 - J^2*Sin[\[Theta]]^4), {\[Theta], 0, Pi/2, \[Pi]}, {\[Phi], 0, 2*\[Pi]}, Assumptions -> a > 0 && J > 0 && a > J^2] Commented Apr 29, 2021 at 19:13
• Really odd. I have a custom built computer that I know has really good specs. I wonder if it being throttled for some reason. I will try the second version you posted too! Thank you! Commented Apr 29, 2021 at 19:55