Repository navigation
A polynomial over a power of a linear beside the root of a quadratic is integrated by undetermined coefficients - #1701
Merged
Rafael-SOWNet merged 6 commits intoOct 3, 2026
Conversation
…is integrated by undetermined coefficients Rubi's 1.2.1.9, P(x) Q^(m/2)/(g + h x)^k, was declined or ran past the corpus's budget wherever the linear was below the bar to a power past the first, and with symbols in it even to the first: the rules for one root of a quadratic take apart a product of distinct linears beside it, and their closed rule for a constant over a linear declined 1/((g + h x) sqrt(a + c x^2)). The rule for the roots of two linears uses nothing of the two but S' = Q'/(2 S): a triangular system for the polynomial part, and a recurrence down the powers of the linear to the integral of 1/((g + h x) S). That core is shared now, and the root of one quadratic is read into it as well. The two integrals left are a logarithm or an arcsine of the quadratic's derivative, by the sign of its leading coefficient, as the root of a quadratic alone is answered; and an artanh or an arctan of (2 q0 h - q1 g + (q1 h - 2 q2 g) x)/(2 sqrt(+-H) S), by the sign of H = h^2 Q(-g/h). Where the sign is a symbol's, both are given, each where it holds. It answers only with the linear below the bar, and a first power of it only with a symbol in it: what the rules further down answer keeps their answers. The answers of the rule for two linear roots are the same as before. Part of #718. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
… it is algebraic Where Q vanishes at the linear's root, Q = beta s + gamma s^2 with s = x - xi, and the derivative of sqrt(Q) s^(-j) is ((1 - 2j) beta s^(-j) + (2 - 2j) gamma s^(1-j))/(2 sqrt(Q)): from int 1/(s sqrt(Q)) = -2 sqrt(Q)/(beta s) up, each power is algebraic, and there is no third integral. Rubi writes these as (a d e + (c d^2 + a e^2) x + c d e x^2)^p over powers of d + e x, and sqrt(d^2 - e^2 x^2) over powers of d + e x, which ran past the budget. And a number times even powers of symbols has the number's sign wherever the symbols are real: the root of d^2 - e^2 x^2 has the arcsine alone, since -e^2 is negative. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…f the discriminant int 1/((g + h x) sqrt(Q)) is -artanh(z)/sqrt(H) where H, h^2 Q at the linear's root, is positive, with z = Z/(2 sqrt(H) sqrt(Q)). Since Z^2 - 4 H Q = (q1^2 - 4 q0 q2) (g + h x)^2, z is less than 1 in size wherever Q has no real root, and the logarithm of (1 + z)/(1 - z) is real, and more than 1 wherever it has two, where the logarithm of (z + 1)/(z - 1) is: the antiderivative of sqrt(4 - x^2)/x^3 is real on the whole of (-2, 2). With symbols, both are given, each where it holds, in one piecewise with the arctangent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…ratic Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…-the-root-of-a-quadratic
…-the-root-of-a-quadratic
This was referenced Oct 3, 2026
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.
P(x) Q^(m/2)/(g + h x)^k, a polynomial over a power of a linear beside a half-odd power of a quadratic, was declined or ran past the corpus's budget wherever the linear was below the bar to a power past the first, and with a symbol in the linear or inQeven to the first. These are Rubi's 1.2.1.9, and withPconstant or linear, much of 1.2.1.2 to 1.2.1.4:1/((g + h x) sqrt(a + c x^2))(d + k x + f x^2) sqrt(a + c x^2)/(g + h x)^4(a + b x + c x^2)^(3/2) (d + k x + f x^2)/(g + h x)^2(2 + x + 3 x^2 - x^3 + 5 x^4) sqrt(3 - x + 2 x^2)/(5 + 2 x)^5(a d m + (c d^2 + a m^2) x + c d m x^2)^(5/2)/(d + m x)^4sqrt(x^2 + 1)/x^2-1/(x/sqrt(1 + x^2))and the logarithm of a quotient of1 ± x/sqrt(1 + x^2)-sqrt(x^2 + 1)/x + ln(2 sqrt(x^2 + 1) + 2 x)What changes. The rule for the roots of two linears (#1697) uses nothing of the two but
S' = Q'/(2 S): a triangular system for the polynomial part, and a recurrence down the powers of the linear to the integral of1/((g + h x) S). That core is shared now, asIntegrateOverARootOfAQuadratic, and the root of one quadratic is read into it too. The answers of the rule for two linear roots are the same as before, on every shape tried.The two integrals left are, with
Q = q0 + q1 x + q2 x^2:int 1/S:ln(2 sqrt(q2) S + 2 q2 x + q1)/sqrt(q2), or-arcsin((2 q2 x + q1)/sqrt(q1^2 - 4 q0 q2))/sqrt(-q2)whereq2 < 0, as the root of a quadratic alone is answered;int 1/((g + h x) S): withH = q0 h^2 - q1 g h + q2 g^2, which ish^2 Qat the linear's root, andZ = 2 q0 h - q1 g + (q1 h - 2 q2 g) x,-artanh(Z/(2 sqrt(H) S))/sqrt(H)whereH > 0, andarctan(Z/(2 sqrt(-H) S))/sqrt(-H)whereH < 0. SinceZ^2 - 4 H Q = (q1^2 - 4 q0 q2)(g + h x)^2, the artanh's argument is less than 1 in size whereQhas no real root and more where it has two; it is written as the logarithm that is real on each side.Where a quantity is a symbol's, every form is given, each where it holds, in one piecewise. Where the linear shares a root with
Q,His zero, and every power of the linear is algebraic:int 1/((x - xi) S) = -2 S/(Q'(xi) (x - xi)), and the recurrence runs up from it.The rule answers only with the linear below the bar, and a first power of it only with a symbol in it. A polynomial beside the root alone, and a constant over a linear with numbers, are what the rules further down answer, and they keep their answers.
Tests:
PowerOfALinearBesideTheRootOfAQuadraticTest: seven symbolic rows each pinned on both sides of the two signs, so that every arm is differentiated back; five beside a shared root; four of Rubi's with numbers; and four checking that the antiderivative is real wherever the integrand is, one on each side of the discriminant, which a differentiation back cannot see.Measured first on the 858 problems of Rubi's 1.2.1.2 to 1.2.1.4 and 1.2.1.9 that the rule can be asked about, both builds side by side, against master
0dd86927:268 more are answered, 126 of them in 1.2.1.3, 74 in 1.2.1.2, 52 in 1.2.1.9 and 16 in 1.2.1.4, and none that master answers is lost. On the 584 that both answer, the total time is 137 s here against 491 s on master. Of the six left, four have a perfect square under the root, which this rule leaves to the rules for a square, and two are the ninth and tenth power of a linear that divides the quadratic, which run to the budget on both builds.
Measured then on the Rubi corpus against master
0dd86927, which is merged in:No answer is wrong on either build.
273 problems moved between the two builds, the pocket's among them, so I re-ran each alone on both. This branch answers all 273, and master none of them.
The suite passes on the commit measured,
1a7f8d68, 14,457 tests, and so does the allocation gate. Master3fba4e5dis merged in since, without conflicts, and the calculus tests pass on the merge, 3,794 of them.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura