Ask Your Question
1

How I can test this equality with sage?

asked 2016-10-30 13:26:31 -0600

Masacroso gravatar image

updated 2016-10-31 19:56:15 -0600

How I can test this equality?

$$\sum_{n=0}^\infty\frac{(-1)^{n+1}}{3 n+6 (-1)^n}=\frac{\log(2)-1}{3}$$

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.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
3

answered 2016-11-01 21:53:01 -0600

rtc gravatar image

updated 2016-11-01 22:16:31 -0600

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 $$\frac{log(2)-1}{3}$$

edit flag offensive delete link more

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 ( 2016-11-02 00:01:44 -0600 )edit

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 ( 2016-11-02 00:23:59 -0600 )edit

@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 ( 2016-11-02 03:29:23 -0600 )edit

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 ( 2016-11-02 12:19:07 -0600 )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: 2016-10-30 13:26:31 -0600

Seen: 76 times

Last updated: Nov 01 '16