# Mathematica crashes after symbolic integration

I have a very serious problem. I want to integrate the function func symbolically. I've checked the result numerical which agrees with literature but I need the analytical expression of the computed integral. However, mathematica crashes after some time. Can somebody take a look at this and help me out

func = (1/(15 \[Pi]))2 (x (-2 + x + z) (15 x^3 + x^2 (-30 + 32 z) +
x (90 + 46 z + 7 z^2) + 2 (-75 + 32 z - 7 z^2 + z^3)) +
2 (-2 + x + z)^3 (-1 + x^2 + 2 x (-2 + z) - 4 z + z^2) Log[
1 - x] -
2 (71 - 115 x + 40 x^2 + 5 (-23 + 4 x) z +
5 (14 - 9 x + 15 x^2) z^2 - 5 (7 - 8 x + 2 x^2) z^3 -
5 (-2 + x) z^4 - z^5) Log[-((-1 + z)/(-1 + x))] -
2 (-1 + x + z) (71 + x^4 - 44 z + 26 z^2 - 9 z^3 + z^4 +
x^3 (-9 + 4 z) + x^2 (26 - 27 z + 6 z^2) +
x (-44 + 52 z - 27 z^2 + 4 z^3)) Log[-1 + x + z] -
60 (-2 + x + z) (-1 + x + z) (Log[-1 + z]^2 -
Log[-((-1 + x + z)/(-1 + x))]^2)) Subscript[\[Alpha], S]


The integration is given as

Integrate[func, {z, 1, 2}, {x, s, (2 - z)},
Assumptions -> {0 < s <= 0.9, 0 < Subscript[\[Alpha], S] < 1}]


Edit: I changed the integration because of some typos.

• Please write an informative title—one that relates to the specific content of your question, not one that could apply to millions of unrelated questions. Apr 23 '20 at 17:25
• Heaviside is not a built-in function. Have you defined it? Or did you mean HeavisideTheta? Apr 23 '20 at 17:29
• Sorry that was a typo. Of course I meant HeavisideTheta
– NeAr
Apr 23 '20 at 17:30
• If 0 < s <= 9/10 then integral is Zero. Apr 23 '20 at 17:32
• I cannot reproduce the crash with 12.1.0 on macOS. After several minutes of running, it returned a result. With crash issues, always post complete version and OS information, and include precise (reproducible) instructions on how to trigger the crash. Apr 23 '20 at 19:03

You have to help Mathematica (12.1 on Windows 10) a little bit, but then you can get an answer in a few minutes:

AbsoluteTiming[
int1 = Integrate[func, x];
int2 = Collect[Expand[ (int1 /. x -> (2 - z)) - ( int1 /. x -> s)],
s];
int3 = Together@
ParallelSum[PrintTemporary[j];
Integrate[int2[[j]], {z, 1, 2},
Assumptions -> {0 < s <= 0.9}], {j, Length@int2}];
]


The result is a bit messy and you may want to simplify the Log and PolyLog functions. Plotting can be done by:

p[s_] = int3 /. Subscript[\[Alpha], S] :> .5;
Plot[Chop[p[s]], {s, 0, .9}]


Which can be verified by comparing to

Plot[NIntegrate[
Evaluate[func /. Subscript[\[Alpha], S] :> .5], {z, 1, 2}, {x,
s, (2 - z)}], {s, 0, .9}, AxesLabel -> {"s", "func"}]