Ask Your Question
1

Integrating Log(x²+y²)

asked 2017-03-10 20:49:41 +0200

RRP gravatar image

updated 2017-03-11 01:15:06 +0200

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-03-11 03:57:55 +0200

Since the arguments of the logarithm are squared, your second integral merely reverses the order of integration compared to the first. The second integral is the negative of the first: if you add them together you'll get zero.

edit flag offensive delete link more

Comments

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?

RRP gravatar imageRRP ( 2017-03-11 12:21:58 +0200 )edit

The answer depends only on L^2, so the sign of L won't change anything.

paulmasson gravatar imagepaulmasson ( 2017-03-11 22:29:40 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-03-10 20:49:41 +0200

Seen: 634 times

Last updated: Mar 11 '17