Repository navigation
The integral over the root of a square quadratic is its modulus's, not the table's - #1672
Merged
Rafael-SOWNet merged 2 commits intoOct 2, 2026
Merged
Conversation
…t the table's The table's entry for k/sqrt(Q) and sqrt(Q) takes a quadratic apart by the sign of its leading coefficient. The arcsine arm divides by the root of the discriminant, and the logarithm arm takes ln|2ax + b + 2 sqrt(a) sqrt(Q)|, which is ln(0) on one side of the root when Q is a square: 1/sqrt(x^2 + 2x + 1) was ln(0) for every x below -1, and 1/sqrt(-a^2 - 2abx - b^2 x^2) NaN at every x. A linear beside the root writes Q in t = 1/(x - p), still a square, and asked the same entry. - The entry does not read a quadratic whose discriminant vanishes. Its root is the modulus of a linear, which the rule for a root of a perfect square writes. - That rule takes a leading coefficient negative for a real parameter too, since sqrt(a (x + h)^2) is sqrt(a) |x + h| for either sign: -a^2 - 2abx - b^2 x^2 is answered with sqrt(-b^2) and b^2 > 0. - The discriminant is tested with its symbols pinned first, and simplified only where it is zero there. Closes #1670. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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 #1670.
The table's entry for
k/sqrt(Q)andsqrt(Q)reads any quadraticQ = A x^2 + B x + Cby the sign ofA. WhenQis a square that breaks: the arcsine divides bysqrt(B^2 - 4 A C), which is zero, and the logarithm is of2 A (x + h) + 2 A |x + h|, which is zero on one side of the root.1/((x - p) sqrt(Q))writesQint = 1/(x - p), still a square, and asks the same entry.The root of a square is the modulus of a linear,
sqrt(A (x + h)^2) = sqrt(A) |x + h|, and the rule for a root of a perfect square already writes that. Now:-b^2among them.sqrt(A s) = sqrt(A) sqrt(s)holds for anyAwhensis not negative, so the root of-(a + b x)^2issqrt(-b^2) |x + a/b|, andb^2 > 0travels with the answer.Compared at points on both sides of each root,
a = 1.3,b = 0.7,c = 0.6,d = 1.9,h = 1.1:1/sqrt(x^2 + 2 x + 1)x < -1sgn(x + 1) ln(x + 1)sqrt(x^2 + 2 x + 1)x <= -1sgn(x + 1) (x^2/2 + x)3/sqrt(9 x^2 - 6 x + 1)x < 1/31/sqrt(-4 - 4 x - x^2)sgn(x + 2) ln(i x + 2 i)/isqrt(-4 - 4 x - x^2)i sgn(x + 2) (x^2/2 + 2 x)1/sqrt(-a^2 - 2 a b x - b^2 x^2)x/sqrt(-a^2 - 2 a b x - b^2 x^2)1/(x sqrt(-a^2 - 2 a b x - b^2 x^2)), Rubi 1.2.1.2 #27371/(x sqrt(a^2 + 2 a b x + b^2 x^2))1/((d + h x) sqrt(a^2 + 2 a b x + b^2 x^2))1/((d + h x) sqrt(-a^2 - 2 a b x - b^2 x^2))1/(x sqrt(c (a + b x)^2))The last is declined because
chas no known sign, so its square is not read as one.Tests:
RootOfAPerfectSquareIntegralTest.TheTableDoesNotReadASquareAsAQuadratic, eleven rows, andASquareOfUnknownSignIsNotAnsweredWrongly, which takes a decline or an answer that holds everywhere. They compare at every point where the integrand has a value, so an answer with no value there fails instead of being skipped. All twelve fail on master.Measured on the Rubi corpus against master
94ba5ff6, which has the same library as master now, with both builds side by side:Five problems moved in the sample, and I re-ran each alone on both builds:
sqrt(-4 + 12 x - 9 x^2)and LaTeXize infinity and tensors correctly #1001/sqrt(-4 - 12 x - 9 x^2)were wrong on master and are right here.sqrt(c d^2 + 2 c d e x + c e^2 x^2)/(d + e x)^4ran past the budget on master and is answered here in 2.6 seconds.(a^2 + b^2/x^(2/5) + 2 a b/x^(1/5))^(5/2)ran past the budget on master and is declined here.The four squares in 1.2.3.2 that master answers and this branch does not are #111, #574, #598 and #607. On master each has no value at 3 to 6 of 6 points when
a b < 0, where the integrand has one. The corpus bindsaandbto positive numbers, so it counted them as solved. The two wrong there, #645 and #647, are declined here too. 2.5.0 declines all six, so none of them changes against the release.The suite passes, 14,324 tests on a fresh build, and so does the allocation gate.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura