Skip to content

Some trivial identities and simplifications missed by Sage (pynac ?) #24211

Open
@EmmanuelCharpentier

Description

@EmmanuelCharpentier

On 8.1.rc0. Consider :

sage: import sympy
sage: [arcsin(t) for t in [0, 1/2, sqrt(2)/2, sqrt(3)/2, 1]]
[0, 1/6*pi, arcsin(1/2*sqrt(2)), arcsin(1/2*sqrt(3)), 1/2*pi]
sage: [maxima.asin(t).sage() for t in [0, 1/2, sqrt(2)/2, sqrt(3)/2, 1]]
[0, 1/6*pi, 1/4*pi, 1/3*pi, 1/2*pi]
sage: [sympy.asin(t)._sage_() for t in [0, 1/2, sqrt(2)/2, sqrt(3)/2, 1]]
[0, 1/6*pi, 1/4*pi, 1/3*pi, 1/2*pi]
sage: [arctan(t) for t in [0, 1/sqrt(3), 1, sqrt(3)]]
[0, arctan(1/3*sqrt(3)), 1/4*pi, arctan(sqrt(3))]
sage: [maxima.atan(t).sage() for t in [0, 1/sqrt(3), 1, sqrt(3)]]
[0, 1/6*pi, 1/4*pi, 1/3*pi]
sage: [sympy.atan(t)._sage_() for t in [0, 1/sqrt(3), 1, sqrt(3)]]
[0, 1/6*pi, 1/4*pi, 1/3*pi]

[ Edit on 2017-11-23 ] In the same vein :

sage: [arccos(t) for t in [0, 1/2, sqrt(2)/2, sqrt(3)/2, 1]]
[1/2*pi, 1/3*pi, arccos(1/2*sqrt(2)), arccos(1/2*sqrt(3)), 0]
sage: [maxima.arccos(t).sage() for t in [0, 1/2, sqrt(2)/2, sqrt(3)/2, 1]]
[1/2*pi, 1/3*pi, arccos(1/2*sqrt(2)), arccos(1/2*sqrt(3)), 0]
sage: [sympy.acos(t)._sage_() for t in [0, 1/2, sqrt(2)/2, sqrt(3)/2, 1]]
[1/2*pi, 1/3*pi, 1/4*pi, 1/6*pi, 0]
sage: [arctan(t) for t in [0, 1/sqrt(3), 1, sqrt(3)]]
[0, arctan(1/3*sqrt(3)), 1/4*pi, arctan(sqrt(3))]
sage: [maxima.arctan(t).sage() for t in [0, 1/sqrt(3), 1, sqrt(3)]]
[0, arctan(1/3*sqrt(3)), 1/4*pi, arctan(sqrt(3))]
sage: [sympy.atan(t)._sage_() for t in [0, 1/sqrt(3), 1, sqrt(3)]]
[0, 1/6*pi, 1/4*pi, 1/3*pi]

This is not a bug stricto sensu (the answers are not false), but is certainly a lack of functionality.

The absence of this problem when using sympy or maxima fingerpoints to pynac.

Furthermore, arctan suffers from some lack of simplification:

sage: assume(-pi/2<x, x<pi/2)  
sage: arctan(tan(x)).simplify()  # OK
x
sage: arctan(sin(x)/cos(x)).simplify()   # should return x as above
arctan(sin(x)/cos(x))
sage: arctan(sin(x)/cos(x)).simplify_full()
arctan(sin(x)/cos(x))

arctan2 has the same issue:

sage: arctan2(sin(x), cos(x)).simplify_full()
arctan2(sin(x), cos(x))

In those cases, the problem is not solved by recourse to pynac...

Depends on #24262

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/24211

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions