Skip to content

A quadratic with rational roots counts as two linears before the substitution search - #1827

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-rational-quadratic-with-rational-roots-counts-as-two-linears
Oct 9, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-rational-quadratic-with-rational-roots-counts-as-two-linears

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

sec(c + d x)^2 sin(c + d x)/(a + b sin(c + d x))^3 ran past thirty seconds, with eight more of Rubi's 4.1 and 4.5. A trace of the routes showed the half-angle substitution writing it as a rational function over (1 - u^2)^2 (a u^2 + 2 b u + a)^3, and SolveBySubstitution spending eighty seconds on it, to decline, before the partial fractions answered it in a fraction of one.

SolveBySubstitution already declines a rational function over written factors with a symbol in their coefficients, linear and quadratic, at least one of them linear -- the partial fractions read those off their roots. 1 - u^2 is two linear factors written together, and IsAProductOfSymbolicLinearFactors counted it as a quadratic, so there was no linear among them. A quadratic with rational coefficients and a discriminant that is the square of a rational now counts as two linears. Two symbolic quadratics alone are still asked of the search, where u = x^2 is often the shorter answer.

integrand 2.5.0 master feb0e25f this
sec(x)^2 sin(x)/(a + b sin(x))^3 declined past 30 seconds 5,017 characters, 1.7 s
tan(x)^2/(a + b sin(x))^3 declined past 30 seconds 4,816 characters, 0.7 s

Tests: AHalfAngleRationalFunctionOverOneMinusTheSquareIntegralTest, the two rows above, each differentiated back and compared at six points.

Measured on every corpus problem of 4.1 and every one with a secant or a cosecant, 8,962 of them, at the corpus's 5-second budget, against master feb0e25f:

master this
solved 8695 8703
unevaluated 128 127
wrong 0 0
past the budget 126 119

On the 8,694 both answer the time goes from 2,781 seconds to 2,647.

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

The harness counts no answer wrong in either. The eleven problems the builds disagreed on, run again one build at a time: nine past the budget on master are answered here -- one each of 4.1.1.2, 4.1.1.3, 4.5.3.1 and 4.5.4.2, three of 4.1.2.2 and two of 4.1.3.1 -- and none the other way; 4.3.7's csc(e + f x)^5 (a + b tan(e + f x)^2)^(3/2), past the budget here in the pocket, is answered by both alone, in 18 and 20 seconds; one of 4.5.4.2 neither answers.

The suite passes: 15,169 passed, 13 skipped, none failed, on the change before its test was added; with it, the related tests pass, 780. The allocation gate passes: every gated benchmark allocates what the baseline says. The library builds for every target.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…titution search

The substitution search declines a rational function over symbolic linear
factors and a quadratic, which the partial fractions split at once; the
half-angle tangent's 1 - u^2 is two linear factors written together and is
counted so. Part of #718.

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 e1a1a3f 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