Opened 3 years ago

Last modified 3 years ago

#25639 new defect

inconsistent powers of symbolic sums

Reported by: rws Owned by:
Priority: major Milestone: sage-8.3
Component: symbolics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by rws)

Pynac immediately factors out the positive content of a sum raised to an integer number:

sage: (5*cos(x) + 5)^2
25*(cos(x) + 1)^2
sage: (5*cos(x) + 5)^-3
1/125/(cos(x) + 1)^3

sage: (-5*x + 5)^-3
-1/125/(x - 1)^3

The last example shows how the leading coefficient is forced to be positive. This is not consistent with other CAS and considered a typical Sage quirk.

Also, the content of rational powers is usually extracted but we only do this if there is a rational power part!

sage: sqrt(5*cos(x) + 5)
sqrt(5*cos(x) + 5)
sage: sqrt(8*x + 8)
2*sqrt(2)*sqrt(x + 1)

Change History (3)

comment:2 Changed 3 years ago by rws

  • Description modified (diff)

comment:3 Changed 3 years ago by rws

The pynac commit given above contains the code for the change but it is not called because many doctests would have to change. If you want to review nevertheless, then please voice your intention here.

Note: See TracTickets for help on using tickets.