Processing math: 100%
Ask Your Question
1

How I can test this equality with sage?

asked 8 years ago

Masacroso gravatar image

updated 8 years ago

How I can test this equality?

n=0(1)n+13n+6(1)n=log(2)13

Im interested in symbolic tests and numerical tests. My knowledge about the way to do this with sage (in general in any CAS, not only sage) is near to zero. Any help, link, etc. will be appreciated, thank you.


EDIT: I tried to use this code (what is a slight simplification of the above equality)

var("n")
sum(1/(n*(-1)^n+2),n,0,oo) == -log(2)+1

but, as expected, it dont work.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 8 years ago

rtc gravatar image

updated 8 years ago

A way to do it is to check if the expression is true with bool() for example

bool(2==2)
True

Or

bool(2==4)
False

With your expression you would have:

var('n')
bool(sum((-1)^(n+1)/(3*n+6*(-1)^n),n,0,oo) == (log(2)-1)/3)

This returns false because sage doesn't seem to be able to prove their equality. So either they aren't equal or sage can't simplify it enough to prove it. So you might have to do some manipulation by hand until you can get it to a simpler state that sage can then work with.

Another option is to do a numerical approximation of the infinite sum:

var('n')
sum((-1)^(n + 1)/(3*n + 6*(-1)^n),n,0,100000).n()
0.102292606438353

((log(2)-1)/3).n()
0.102284273146685

This code approximates the sum with the first 100,000 terms. We can see that the numerical approximation of this function does seem to approach log(2)13

Preview: (hide)
link

Comments

This series is difficult to test. The equality is true but it fail in many CAS not only sage: mathematica, maple, sympy, etc... In mathematica, and probably all the other CAS, it is possible to see the value of the series after some manipulations. But I wanted to know if it would be possible in sage in a direct way.

Masacroso gravatar imageMasacroso ( 8 years ago )

You can't get it directly, as far as I know. It seems to be a difficult sum for CAS to solve.

rtc gravatar imagertc ( 8 years ago )

@rtc for this question if we define f(n) = (-1)^(n+1)/(3n+6(-1)^n) and after we do sum(f(2n)+f(2n+1),n,0,oo) the answer is close to the truth but is not correct. But the same code (with light change due to be different languages) works in mathematica and maple perfectly, obtaining the correct answer. Why sage is not doing well here?

Masacroso gravatar imageMasacroso ( 8 years ago )

That is a very good question. I am going to ask another question to see if someone knows. It seems that sage is improperly computing this sum. https://ask.sagemath.org/question/353...

rtc gravatar imagertc ( 8 years ago )

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: 8 years ago

Seen: 3,522 times

Last updated: Nov 02 '16