Ask Your Question

RRP's profile - activity

2017-07-27 00:58:08 +0200 received badge  Popular Question (source)
2017-03-11 12:21:58 +0200 commented answer Integrating Log(x²+y²)

You are right, when we add the results we get zero. But this don't make sense. The subtraction should be zero, since L>0. So, this is something that I don't formulate very well in Sage? Or is something about my adaptation to Sage?

2017-03-11 03:19:03 +0200 received badge  Student (source)
2017-03-11 01:15:06 +0200 received badge  Editor (source)
2017-03-10 20:49:41 +0200 asked a question Integrating Log(x²+y²)

I'm making the following calculations:

X,Y,L=var('X,Y,L')

assume(L>0)

F(L)=integrate(integrate(log((X)^2+(Y)^2),Y,L/2,3*L/2),X,-L/2,L/2)

Maxima requested tor assume(4*X^2+L^2-4>0) and for assume(L-2>0), so I run the following

X,Y,L=var('X,Y,L')

assume(L>0)

assume(4*X^2+L^2-4>0)

assume(L-2>0)

F(L)=integrate(integrate(log((X)^2+(Y)^2),Y,L/2,3*L/2),X,-L/2,L/2)

print(F)

and the result is

-1/4piL^2 + 1/2L^2(arctan(3) - 9arctan(1/3) - 2) + 9L^2arctan(1/3) + 3/2L^2log(5/2L^2) - 1/2L^2log(1/2L^2) - 2L^2

After this, I change the limits of the integration

X,Y,L=var('X,Y,L')

assume(L>0)

assume(4*X^2+L^2-4>0)

assume(L-2>0)

F(L)=integrate(integrate(log((X)^2+(Y)^2),Y,-3*L/2,-L/2),X,-L/2,L/2)

print(F)

and the result is

1/4piL^2 - 1/2L^2(arctan(3) - 9arctan(1/3) - 2) - 9L^2arctan(1/3) - 3/2L^2log(5/2L^2) + 1/2L^2log(1/2L^2) + 2L^2

If we subtract this to results and considering L=10 The result should be Zero, but the result is very different

Z(L)=(-1/4piL^2 + 1/2L^2(arctan(3) - 9arctan(1/3) - 2) + 9L^2arctan(1/3) + 3/2L^2log(5/2L^2) - 1/2L^2log(1/2L^2) - 2L^2)-(1/4piL^2 - 1/2L^2(arctan(3) - 9arctan(1/3) - 2) - 9L^2arctan(1/3) - 3/2L^2log(5/2L^2) + 1/2L^2log(1/2L^2) + 2L^2)

Z(10).n()


922.636418333173

I know that the result should be zero from the math and I also use the software Mathematica.

The question is: I'm making something wrong? Or this is a well known problem of Sage?

2016-04-22 17:48:25 +0200 received badge  Scholar (source)
2016-04-22 17:21:43 +0200 answered a question Sage vs. Mathematica. Which on believe?

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

The minus sign in Sage is really very weird.

Thanks.

2016-04-21 16:09:27 +0200 asked a question 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?