Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Equality test of symbolic expressions

I'm confused about the equality test of symbolic expressions. I saw the recently asked question https://ask.sagemath.org/question/41735/how-to-get-a-truefalse-for-complex-numbers/ and, coincidently, I read something similar on the first page of the second chapter of this book http://dl.lateralis.org/public/sagebook/sagebook-web-20130530.pdf. It says that Sage evaluates the following expressions as below,

sage: bool(arctan(1+abs(x)) == pi/2 - arctan(1/(1+abs(x))))
False
sage: bool(arctan(sqrt(2)) == pi/2 - arctan(1/sqrt(2)))
True

In Wikipedia (https://en.wikipedia.org/wiki/List_of_trigonometric_identities), we can verify the corresponding trigonometric identity.

$ arctan\left(x\right) + arctan\left(\frac{1}{x}\right) = \frac{\pi}{2}, \; if \; x>0$

and

$ arctan\left(x\right) + arctan\left(\frac{1}{x}\right) = -\frac{\pi}{2}, \; if \; x<0$

The above evaluation works as is in the version I am using.

sage: version()
'SageMath version 7.5.1, Release Date: 2017-01-15'

However, in Sage Math Cell or Cocalc ('SageMath version 8.1, Release Date: 2017-12-07') both tests evaluate to False.

Mathematica is not able to evaluate any of the expressions and return the entire equality test without evaluation.

Questions:

1) I understand that both tests should evaluate to True, am I right? If so, and as Sage 7.5.1 can verify the second equality, why it can't verify the first?

2) Why the newer version of Sage cannot verify the second equation anymore?

3) Differently from Mathematica, that returns True if both expressions are numerically equal, False otherwise and returns the test unevaluated if it cannot establish the equality, Sage returns True if it can prove that the difference between both expressions is zero and False otherwise. Is this correct?