# Mathematica can't compute this integral (but can a very similar one)

I am having a hard time to understand why Mathematica can't compute the following integral:

u2[z_] = 1/(1 + (Sqrt[2] - 1) Exp[z])^2
u2z[z_] = D[u2[z], z]
Rmono[z_] = Simplify[u2[z]*(1 - u2[z])]
Integrate[z*Rmono[z]*u2z[z], {z, y, \[Infinity]}]


while it can compute the very similar:

u1[z_] = 1/(1 + Exp[z])
u1z[z_] = D[u[z], z]
Rbistable[z_, a_] = Simplify[u1[z]*(1 - u1[z])*(u1[z] - a)]
Integrate[z*Rbistable[z, a]*u1z[z], {z, y, \[Infinity]}]


Is there a way to ask Mathematica to try harder? I know the integrand is more elaborate in the first integral but it looks like there is no conceptual barrier.

I am using version 12.1.

• As a side note, Mathematica definite integrals are often significantly slower than indefinite ones. If you evaluate the indefinite integral, it returns immediately. This is because by default, Mathematica works in the complex plane and can't assume analyticity. If you know that the Fundamental Theorem of Calculus applies, it's often faster to compute the indefinite integral and plug in this two endpoints. – Sami May 5 '20 at 10:19

Assumption seems to help it do it

  anti = Integrate[z*Rmono[z]*u2z[z], {z, y, Infinity}, Assumptions -> y >= 0]


  anti = Integrate[z*Rmono[z]*u2z[z], {z, y, Infinity},   Assumptions -> y <= 0]


Another way is

anti = Integrate[z*Rmono[z]*u2z[z], z];
sol3 = (Limit[anti, z -> Infinity] - Limit[anti, z -> y]) // Simplify


Update:

And another assumption which works, per suggestion given in the comment below is

anti=Integrate[z*Rmono[z]*u2z[z],{z,y,Infinity},
Assumptions->Element[y,Reals]]//Simplify


• Even Assumptions -> y \[Element] Reals helps. – user64494 May 5 '20 at 10:20