Skip to content

Symbolic factors of a denominator that share a factor are written over it - #1687

Merged
Rafael-SOWNet merged 4 commits into
masterfrom
symbolic-factors-written-over-their-common-factors
Oct 2, 2026
Merged

Rafael-SOWNet merged 4 commits into
masterfrom
symbolic-factors-written-over-their-common-factors

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

The partial fractions over factors with symbols in them read the written factors as coprime and squarefree. The refactoring after them reads rational coefficients only. So a quadratic that shares a root with a linear beside it, or that is a square, was read as an irreducible quadratic:

integrand master written over what the factors share this
1/((d + e x)(a d e + (c d^2 + a e^2) x + c d e x^2)^2) declined after 3.8 s 1/((d + e x)^3 (a e + c d x)^2), 74 ms 0.4 s
(d + e x)^6/(a d e + (c d^2 + a e^2) x + c d e x^2)^4 past 30 s (d + e x)^2/(a e + c d x)^4, 11 ms 2.6 s
1/((d + e x)^2 (c d^2 + 2 c d e x + c e^2 x^2)^3) declined 1/(c^3 (d + e x)^8), 5 ms 0.1 s
x^2/((a + b x)(a^2 + 2 a b x + b^2 x^2)) declined x^2/(a + b x)^3 0.04 s

These are Rubi's 1.2.1.2, (d + e x)^m (a d e + (c d^2 + a e^2) x + c d e x^2)^p, whose quadratic is (d + e x)(a e + c d x), and its squares.

What changes. Before the symbolic split, the written factors are taken apart over their greatest common divisors until they are coprime and squarefree, using the multivariate gcd the library already has:

  • each pair of factors over what they share;
  • each factor over what it shares with its derivative in x;
  • a factor over what it shares with the numerator, which is then cancelled.

A part a divisor leaves that is free of x goes in front whole, with its sign: a divisor is found up to a unit, and -(b x^2 - 1)^2 taken apart over its derivative leaves -1. A common factor that is a power of x alone is not split over. Taking a power of x out of a factor is the content's, which runs before this, and split here it wrote the rest of the factor monic with a symbol below its bar: Rubi's 1.1.4.3 x^12 (A + B x^2)/(b x^2 + c x^4)^3 came to an answer of four million characters, where the content's way gives seven thousand.

The divisors are taken over the rationals in every variable, so whatever of the symbols alone comes with one goes in front. Each factor is written monic in x, as the integrator writes one. Written with whole coefficients, the next normalisation took the leading coefficient out again, and the answer carried e^(-8) e^8. A coefficient with a symbol below a bar is put over one bar first, so a/c + (c d^2 + a e^2)/(c d e) x + x^2, which is how the integrator writes the quadratic, is read too.

SolveByCancellingWithFunctionsAsIndeterminates has a squarefree factorisation of its own, but only for a denominator with a function of x in it. It reads the denominator as one product, so factors of the same multiplicity come back multiplied together. Here the written factors stay apart.

Tests: SymbolicFactorsPartialFractionsTest.FactorsThatShareOneAreWrittenOverIt, the four rows above, each differentiated back with the symbols pinned; all four fail on master. And TheNegativeOfASquareKeepsItsSign, three rows, Rubi's 1.1.2.2 x^4/(a + b x^2)^(3/2) among them.

Measured on the Rubi corpus against master 94ba5ff6. The master column was measured beside an earlier commit of this branch; the branch column is this commit, run afterwards over the same samples:

master this
family 1, 40 a file (1381) 1117 1121
family 0, independent suites (1814) 1757 1758
families 2 to 8, sampled (2586) 2363 2362

Both builds give the same two wrong answers in family 1, 1.2.1.1's roots of negative squares, which #1672 fixed on master after this branch's base, and the same one in family 7, which #1682 fixed.

27 problems moved between the two runs, and on a machine this loaded that includes problems near the budget either way, so I re-ran each alone on both builds. This branch answers 19 of them and master 7, neither wrongly, and none that master answers is lost.

The suite passes, 14,319 tests on a fresh build, and so does the allocation gate.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 4 commits October 2, 2026 07:48
…r it

The partial fractions over written symbolic factors read them as coprime
and squarefree, and the refactoring after them reads rational
coefficients only. A quadratic that shares a root with a linear beside
it, (d + e x)(a d e + (c d^2 + a e^2) x + c d e x^2)^2, or is a square,
c d^2 + 2 c d e x + c e^2 x^2, was read as an irreducible quadratic: the
first was declined after four seconds, (d + e x)^6/(a d e + ...)^4 ran
past thirty, and x^2/((a + b x)(a^2 + 2 a b x + b^2 x^2)) was declined.

The written factors are now taken apart over their greatest common
divisors, with one another and each with its derivative in x, by the
multivariate gcd the library has, until they are coprime and
squarefree; a factor shared with the numerator is taken apart the same
way and cancelled. Each factor is written monic in x, as the integrator
writes one, with what is free of x in front. Each of the four above is
answered, under three seconds.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…share

Measured on the 2.5.0 tag and on this branch.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
A divisor is found up to a unit, so taking -(b u^2 - 1)^2 apart over its derivative leaves a part
-1, whose content is 1, and the part was dropped with its sign: the denominator came out as the
square. A part free of the variable now goes in front whole. Rubi's 1.1.2.2 x^4/(a + b x^2)^(3/2)
is this under t = x/sqrt(a + b x^2).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
The split over common factors took b x^2 + c x^4 apart over its
derivative as x^2 (b/c + x^2) c. Over that monic quadratic, with a
symbol below its bar, Rubi's 1.1.4.3 x^12 (A + B x^2)/(b x^2 + c x^4)^3
had an answer of four million characters, and checking it ran past the
budget. Taking a power of x out of a factor is what the content does,
before this split, and with the content taken out the answer has seven
thousand characters. A common factor that is a power of x alone is now
not split over.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 2, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit e33fbab into master Oct 2, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant