Question: indefinite integral gives division by zero

 

restart;
expr:=a^2*(2*a^2*p^3-a^2*((p^2+1)^2*(a^2-1))^(1/2)-((p^2+1)^2*(a^2-1))^(1/2)*p^2+2*p*a^2-2*p^3+((p^2+1)^2*(a^2-1))^(1/2)-2*p)/((p^2+1)^2*(a^2-1))^(1/2)/(p^3-((p^2+1)^2*(a^2-1))^(1/2)+p)/(a^2-p^2-1);
int(expr,p)

Gives

why does Maple give division by zero?

Here is the result from integration package on Mathematica

ClearAll[a, p];
expr = a^2*(2*a^2*p^3 - 
       a^2*((p^2 + 1)^2*(a^2 - 1))^(1/2) - ((p^2 + 1)^2*(a^2 - 1))^(1/
           2)*p^2 + 2*p*a^2 - 2*p^3 + ((p^2 + 1)^2*(a^2 - 1))^(1/2) - 
       2*p)/((p^2 + 1)^2*(a^2 - 1))^(1/
        2)/(p^3 - ((p^2 + 1)^2*(a^2 - 1))^(1/2) + p)/(a^2 - p^2 - 1)
<< Rubi`
Int[expr, p]

Which it can integrate. Result is a little long. (removed since looks too long)

But my question really is not why Maple could not integrate it, but why the division by zero? 

Maple 2020.1

Please Wait...