Skip to content

inconsistent powers of symbolic sums #25639

@rwst

Description

@rwst

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)

Component: symbolics

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

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