Question: why such different result from integrate when pulling minus sign out?

These two expressions are the same, just pulled minus sign out

But look what happens when integrating them. the anti derivative of one is much more complicated than the other and contains complex numbers and logs. And no matter what I tried, I could not convert the complicated one to look same as the simpler result. Also could not verify the complicated one by back differentiating.

integrand_1:=x^2*(-arctan(x) + x)*exp(-arctan(x) + x)/(x^2 + 1);

x^2*(-arctan(x)+x)*exp(-arctan(x)+x)/(x^2+1)

integrand_2:=evala(integrand_1);

-x^2*(arctan(x)-x)*exp(-arctan(x)+x)/(x^2+1)

simplify(integrand_1 - integrand_2)

0

anti_1:=int(integrand_1,x);

(-arctan(x)+x)*exp(-arctan(x)+x)-exp(-arctan(x)+x)

anti_2:=int(integrand_2,x);

-(1-x+((1/2)*I)*ln(1-I*x)-((1/2)*I)*ln(1+x*I))*(1-I*x)^(-(1/2)*I)*(1+x*I)^((1/2)*I)*exp(x)

simplify(diff(anti_1,x)-integrand_1);

0

simplify(diff(anti_2,x)-integrand_2);

Error, (in simpl/simpl/ReIm/sum) too many levels of recursion

simplify(anti_1 - anti_2)

Error, (in simpl/simpl/ReIm/sum) too many levels of recursion

simplify(anti_2);

(1/2)*(I*ln(1+x*I)-I*ln(1-I*x)+2*x-2)*(1-I*x)^(-(1/2)*I)*(1+x*I)^((1/2)*I)*exp(x)

simplify(anti_2,ln);

(1/2)*(I*ln(1+x*I)-I*ln(1-I*x)+2*x-2)*(1-I*x)^(-(1/2)*I)*(1+x*I)^((1/2)*I)*exp(x)

 

 

Download int_strange_result_april_27_2025.mw

I would have expected same anti derivative to show.  To check, I used another software, and that one gave same anti-derivative for both integrands.

The questions I have: Why Maple gives such different result for same integrand? And how could one convert the one with the logs and complex numbers to the first one?

Maple 2025

Please Wait...