Skip to content

A quadratic is split over a root it shares with a linear beside it - #1693

Merged
Rafael-SOWNet merged 3 commits into
masterfrom
a-quadratic-split-over-a-root-it-shares
Oct 2, 2026
Merged

Rafael-SOWNet merged 3 commits into
masterfrom
a-quadratic-split-over-a-root-it-shares

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

Writing each linear once (#1683) read a quadratic's roots only where they are a monomial and its negative. Rubi's 1.2.1.2 and 1.2.1.4 put a d e + (c d^2 + a e^2) x + c d e x^2, which is (d + e x)(a e + c d x), beside a power of d + e x. Under a power that is not whole, nothing split it, and the integral was declined or ran out of time.

A quadratic now takes the root of a linear written elsewhere in the integrand where it vanishes there, and its other root by the sum of the two. Each linear is then written once, with K in front, as in #1683:

integrand master this
sqrt(d + e x)/sqrt(a d e + (c d^2 + a e^2) x + c d e x^2) declined 8 ms
(d + e x)^(3/2)/sqrt(a d e + ...) declined 18 ms
(d + e x)^(7/2)/(a d e + ...)^(3/2) declined after 0.4 s 65 ms
(f + g x)(a d e + ...)^(3/2)/(d + e x)^(3/2) declined after 2.1 s 19 ms
(d + e x)^(5/2)/((f + g x)(a d e + ...)^(5/2)) declined after 15 s 0.6 s
sqrt(a d e + ...)/((f + g x)^(7/2) sqrt(d + e x)) declined 0.2 s

The split is made only where the shared linear stands under a root too, so that its two roots come together as one whole power, and only where that leaves two linears or fewer. Beside a whole power of the linear, as in (d + e x)^3 sqrt(a d e + ...), the split would leave two roots where there was one, and the rules for a quadratic under a root answer it as written. Beside a third linear, as in x sqrt(a d e + ...)/(d + e x), it would leave a product of three that the rules for two don't answer, and written so that one grows past what fits in memory. In both cases the quadratic is read whole, as on master.

Tests: EachLinearWrittenOnceIntegralTest.IsAnsweredWithEachLinearOnce gains three rows with the shared root, (d + h x)^(7/2)/(a d h + ...)^(3/2) among them, each differentiated back with the symbols pinned. All three are declined on master. BesideAThirdLinearTheQuadraticIsReadWhole has two rows with a third linear, the first of which runs out of memory if the split is made there.

Measured on the Rubi corpus against master 7edf3285, both builds side by side. Every problem of 1.2.1.2 and 1.2.1.4 with a d e + (c d^2 + a e^2) x + c d e x^2 in it, 431 whose answers are in functions the library has, at the corpus's 5-second budget:

master this
solved 204 349
wrong 0 0

145 more are answered, and none that master answers is lost. On the 204 that both answer, the total time is 401 s here against 390 s on master, under load. Twelve that neither answers now run to the budget, where master declines them in under half a second. After the split they are a power of the linear below the bar beside one root, K/((d + e x)^5 (a e + c d x)^(3/2)), or two linear radicals, K (f + g x)^(5/2)/sqrt(a e + c d x), which the rules for those don't finish in five seconds.

The corpus chain ran on an earlier commit of this branch, which also split a square and split beside a whole power of the linear. Against the same master it measured family 0 at 1758 on both, family 1 at 40 a file at 1126 against 1119, and the samples of families 2 to 8 at 2141 against 2140, with no wrong answers on either build. This commit splits in a subset of those cases.

The suite passes on this commit, 14,374 tests, and so does the allocation gate. Master 61de03de is merged in since, without conflicts, and the calculus tests pass on the merge, 3,698 of them.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 3 commits October 2, 2026 18:28
Writing each linear once read a quadratic's roots only where they were
a monomial and its negative. Rubi's 1.2.1.2 and 1.2.1.4 have
a d e + (c d^2 + a e^2) x + c d e x^2, which is (d + e x)(a e + c d x),
beside a power of d + e x: under a power that is not whole, nothing
splits it, and (d + e x)^(7/2)/(a d e + ...)^(3/2) was declined.

A quadratic beside a linear under a root now takes the linear's root
where it vanishes there, and its other root by the sum of the two. The
two roots of the shared linear are then one whole power of it, and
where that leaves two linears or fewer the rule answers:
(d + e x)^(7/2)/(a d e + ...)^(3/2) is K (d + e x)^2/(a e + c d x)^(3/2).
Beside a whole power of the linear, (d + e x)^3 sqrt(a d e + ...), the
split would leave two roots where there was one, and the rules for a
quadratic under a root answer it as written; beside a third linear,
x sqrt(a d e + ...)/(d + e x), it would leave a product of three. In
both the quadratic is read whole.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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 a34dbc3 into master Oct 2, 2026
34 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the a-quadratic-split-over-a-root-it-shares branch October 29, 2026 00:43
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