Skip to content

A symbolic quartic in x^2 with a square discriminant, split before the partial fractions - #1831

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
biquadratics-split-over-the-symbols
Oct 9, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
biquadratics-split-over-the-symbols

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

cot(c + d x)^3 sqrt(a + b sec(c + d x)) ran past the corpus's budget, with two more of Rubi's. The time went to the partial fractions over a symbolic quartic in x^2 that is two quadratics in it. The root of the linear makes x^2/((x^2 - a)(x^4 - 2a x^2 + a^2 - b^2)^2) of the first. Nothing below reads a symbolic quartic, and that one ran past a minute. Written over (x^2 - a - b)(x^2 - a + b) it is answered in a fifth of a second.

SolveByPartialFractions now writes each factor A x^4 + B x^2 + C with symbols in it, whose discriminant B^2 - 4AC is the square of a polynomial S in them, as (2A x^2 + B - S)(2A x^2 + B + S)/(4A) before the splits below. MultivariatePolynomial.TrySquareRoot finds S, exactly over the rationals, or says there is none.

integrand 2.5.0 master e7ef0b75 this
cot(x)^3 sqrt(a + b sec(x)) declined past 60 seconds 36,760 characters, 3.7 s
cot(x)/(a + b sec(x))^(3/2) declined declined after 11 s 22,324 characters, 1.1 s
sec(x)^2/(a sin(x) + b tan(x))^2 declined past 60 seconds 68,854 characters, 22 s

x stands for e + f x, which is what was probed. The answers are long: each carries a case for each sign of the roots of the two quadratics, and Rubi's are a few hundred characters. They are right, and nothing else answers these.

Tests: SymbolicBiquadraticSplitIntegralTest, x^2/((x^2 - a)(x^4 - 2a x^2 + a^2 - b^2)^2) and sqrt(a + b x)/(x (x^2 - 1)^2), each differentiated back and compared at six points.

Measured on 14,109 corpus problems, every one whose integrand is a rational function and every one with a secant or a cosecant in it, at the corpus's 5-second budget, against master e7ef0b75:

master this
solved 13889 13892
unevaluated 99 97
wrong 0 0
past the budget 108 107

Three problems are answered here and not on master, two of 4.5.1.4 and one of 4.7.2, and none the other way. On the 13,889 both answer the time is 2,574 seconds on master and 2,532 here.

master this
family 0, independent suites (1814) 1782 1782
family 1, 40 a file (1381) 1341 1340
families 2 to 8, sampled (2410) 2331 2331

The harness counts no answer wrong in either. The five problems the builds disagreed on, run again one build at a time:

  • the three above: master answers none, this all three;
  • 1.1.2.4's x^4/((a + b x^2)^2 (c + d x^2)^3), the family-1 difference: both answer it, in 20 s on master and 18 s here, near the budget whichever runs it;
  • 4.7.5's csc(a + b log(c x^n)) pair: both decline it, in about 24 s.

The suite passes: 15,182 passed, 13 skipped, none failed. The allocation gate passes: every gated benchmark allocates what the baseline says. Merged with master: the library builds for every target.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 2 commits October 9, 2026 06:16
…e partial fractions

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 9, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 60b8111 into master Oct 9, 2026
34 checks passed
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