Repository navigation
Symbolic factors of a denominator that share a factor are written over it - #1687
Merged
Rafael-SOWNet merged 4 commits intoOct 2, 2026
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
1/((d + e x)(a d e + (c d^2 + a e^2) x + c d e x^2)^2)1/((d + e x)^3 (a e + c d x)^2), 74 ms(d + e x)^6/(a d e + (c d^2 + a e^2) x + c d e x^2)^4(d + e x)^2/(a e + c d x)^4, 11 ms1/((d + e x)^2 (c d^2 + 2 c d e x + c e^2 x^2)^3)1/(c^3 (d + e x)^8), 5 msx^2/((a + b x)(a^2 + 2 a b x + b^2 x^2))x^2/(a + b x)^3These 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:
x;A part a divisor leaves that is free of
xgoes in front whole, with its sign: a divisor is found up to a unit, and-(b x^2 - 1)^2taken apart over its derivative leaves-1. A common factor that is a power ofxalone is not split over. Taking a power ofxout 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.3x^12 (A + B x^2)/(b x^2 + c x^4)^3came 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 carriede^(-8) e^8. A coefficient with a symbol below a bar is put over one bar first, soa/c + (c d^2 + a e^2)/(c d e) x + x^2, which is how the integrator writes the quadratic, is read too.SolveByCancellingWithFunctionsAsIndeterminateshas a squarefree factorisation of its own, but only for a denominator with a function ofxin 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. AndTheNegativeOfASquareKeepsItsSign, three rows, Rubi's 1.1.2.2x^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: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