# Sage vs. Mathematica. Which on believe?

In Phd thesis, I'm having some trouble to calculating some tricky integrals, Sage and Mathematica show different results. To understand what goes I have calculated a simple integral.

At Sage:

var('y')
assume(y>0)
integral(log(sqrt(x^2+y^2),10),x,-10,-1)


Result: -1/2(2yarctan(10/y) - 2yarctan(1/y) + 10log(y^2 + 100) - log(y^2 +1) - 18)/log(10)

At Mathematica:

Assuming[y > 0, Integrate[log10 (Sqrt[x ^2 + y^2]), {x, -10, -1}]]


Result: 1/2 log10 (-Sqrt[1 + y^2] + 10 Sqrt[100 + y^2] + y^2 Log[(10 + Sqrt[100 + y^2])/(1 + Sqrt[1 + y^2])])

If we plot the results the output in the interval (y,-8,8), the plots will be very different. I'm making any mistake? Why this happens? Which one should I believe?

edit retag close merge delete

Sort by ยป oldest newest most voted

Your Mathematica input is slightly off. Here's what you want:

Assuming[y > 0, Integrate[Log[10, Sqrt[x^2 + y^2]], {x, -10, -1}]]

This gives an answer with the same absolute value as Sage, but the latter returns an odd extra minus sign. You'll get the same answer for both if you change the variable of integration:

integral(log(sqrt(x^2+y^2),10),x,1,10)

more

Thanks, I really didn't realize about that difference between "log" and "Log" since mathematica keep producing results.

Thanks.

more