Repository navigation
A coefficient that is zero as a value is no degree, nor a root - #1682
Merged
Merged
Conversation
With symbols for its coefficients, the radical substitution leaves coefficients that are zero as values and not as written. `e^(3 acoth(a x))/(c - a c x)^3` becomes `u^4 (a - a u^2)` over `(-(a - a u^2) + -(u^2 + 1) a)^3`, which is `-8 a^3`; expanded, it leaves `-3 a^3 + 3 a^3` at `u^6`, which nothing collects, and the long division divided by that and answered NaN. `e^(2 acoth(a x)) sqrt(c - a c x)/x` leaves `((c - u^2)/c - 1)(u^2 - c)`, whose constant term `-(c/c - 1) c` is zero, and the biquadratic rule took one of its roots in `u^2` to be zero. `PartialFractions.IsZeroAsAValue` decides zero the way `InLowestTermsOverTheSymbols` does: over one bar, the numerator expanded is zero as written, as a number, or at two sets of pinned symbols. The long division drops a leading coefficient of the divisor that is zero so, and the biquadratic rule declines a constant term, leading coefficient or discriminant that is. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
… c x 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
This was referenced Oct 2, 2026
Merged
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.
Closes #1665.
Both NaN answers come from a coefficient that is zero as a value and not as written. The radical substitution leaves such coefficients behind when the integrand has symbols for its coefficients.
e^(3 acoth(a x))/(c - a c x)^3, under the root of the quotient, isu^4 (a - a u^2)over(-(a - a u^2) + -(u^2 + 1) a)^3, which is-8 a^3. The long division reads its divisor's degree off the divisor expanded.Expandwrites(u^2)^2besideu^4, andu^2 (u^2)^2besideu^6, and the coefficients it reads off are-6 a^3 + 6 a^3and-3 a^3 + 3 a^3. NeitherInnerSimplifiednorEvaledcollects those, so the division took a sextic with leading coefficient-3 a^3 + 3 a^3, divided by it, and the quotient was NaN.e^(2 acoth(a x)) sqrt(c - a c x)/xleaves((c - u^2)/c - 1)(u^2 - c), which is-u^2 (u^2 - c)/c. Its constant term reads as-(c/c - 1) c, which is zero, so one of its roots inu^2is zero too.SolveAnEvenPolynomialOverASymbolicBiquadraticanswered it withatan(u/sqrt(r))/sqrt(r)atr = 0. That is where-(2 * 1/c * c - 1) + 1came from, and whySimplifyturned the answer into NaN.PartialFractions.IsZeroAsAValuedecides zero the wayInLowestTermsOverTheSymbolsalready does: over one bar, the numerator expanded is zero as written, as a number, or at two sets of pinned symbols. The long division now drops leading coefficients of the divisor that are zero that way. The biquadratic rule now declines a constant term, leading coefficient or discriminant that is zero that way, and the rules behind it answer instead.All five of the issue's integrals now answer:
and each answer's derivative agrees with its integrand at real points where the integrand is real, for
cof either sign.Tests:
ACoefficientThatIsZeroAsAValueIsReadAsZerochecks the derivative of each answer against the integrand, withaandcpinned andcof both signs, and checks that no NaN appears.LongDivisionLeadingCoefficientTestdivides by the substitution's own divisor and checks the quotient and remainder by value. It also has the zero and nonzero cases ofIsZeroAsAValue.Without the fix, 10 of the 13 fail. The other 3 are the nonzero cases.
Measured on the Rubi corpus against master
38974356, which has the same library as this branch's base422c7112, with both builds side by side:Seven problems moved, and I re-ran each alone on both builds:
All 17 still wrong in family 7 are in 7.3.6. They are the
e^atanhshapes that #1663 and #1669 fixed on master after this branch's base.The suite passes, 14,316 tests on a fresh build, and so does the allocation gate.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura