Skip to content

A polynomial over a power of a quadratic beside the root of another is reduced a power at a time - #1595

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-linear-over-a-power-of-a-quadratic-beside-a-root
Sep 29, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-linear-over-a-power-of-a-quadratic-beside-a-root

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718: P/(A^k sqrt(B)) with two different quadratics and k at least two, one power of A at a time down to the closed form #1583 gives for k = 1. Symbols in the coefficients are included.

The reduction. Over A^j, P is L + A R with L linear, and R goes a power down as it is. For L = g + h x, the derivative of (p + q x) sqrt(B)/A^(j - 1) is (2 q A B + (p + q x) W)/(2 A^j sqrt(B)) with W = B' A - 2 (j - 1) B A'. So L/(A^j sqrt(B)) is that derivative plus S/(A^(j - 1) sqrt(B)) wherever 2 L = 2 q A B + (p + q x) W + 2 A S. That is five linear equations, one for each power of x up to the fourth, in p, q and the three coefficients of a quadratic S. They have a solution where A and B have no root in common. This is Hermite's reduction, which is how Rubi's 1.2.1.6 takes these. Over A itself, what is left is sigma A + L: sigma over the root alone, and L over A beside it, which #1583's rule closes.

Solved by hand. The general linear solver over the symbols took 28 s on the five equations and then failed. They don't need it: the fourth power's equation gives S2 = 2 q B2 (j - 2), the third's and the second's give S1 and S0 linear in p and q, and the first's and the constant's are then two equations in p and q, solved by their determinant. Past a bound on the size of p + q x, the reduction declines rather than grind: with six symbols the cube's coefficients reach 10,700 nodes at the second step.

Where it comes from. It is a rule of its own, beside #1583's, and a piece the rational function beside a root is now split into as well. With #1584's half-angle tangent, sqrt(a + a sec(x))/(c + d sec(x))^2 becomes (1 - t^2)^(3/2)/((1 + t^2)((c + d) + (d - c) t^2)^2) in t = tan(x/2), and the square below the bar is this. Two more things stood in the way of those rows:

  • Half-odd powers of a ± a sec and a ± a csc by the half-angle tangent #1584's rule asked the chain for its rational function in t, and the substitution search ahead of the rule for a rational function beside a root spent the budget on it. It now asks that rule first, and the chain only if it declines.
  • The split beside the root asked for the integral of a piece that was zero with a condition on it, 0 provided not 1 - t^2 = 0, and declined on it. Such a piece is now dropped as the zero it is.
Input Was (2.5.0) Master Now
(g + h*x)/((d + k*x + f*x^2)^2*sqrt(a + b*x + c*x^2)) integral(...) declined a linear times the root over the quadratic, and two arctangents
(7 + 13*x)/((5 + x + 2*x^2)^3*sqrt(2 + x + 3*x^2)) integral(...) declined answered
sqrt(a + a*sec(x))/(c + d*sec(x))^2 integral(...) past the budget an antiderivative in tan(x/2)

QuadraticBesideARootIntegralTest differentiates seven more integrands back with the symbols pinned.

Measured with work/intbench against master at dd728251, the commit this is cut from, 3 s a problem:

  • Rubi's rows with a half-odd power of a ± a sec or a ± a csc (970 problems): 937 → 946 solved, none lost, 0 wrong. Eight of the 4.5.2.1 timeouts Half-odd powers of a ± a sec and a ± a csc by the half-angle tangent #1584 left are answered, in 69 to 466 ms: (a + a sec)^(k/2) over the square or cube of c + d sec. So is 4.5.2.3:312, which master declined after 4.7 s. Timeouts fall from 13 to 5, and the rows take 200 s instead of 328 s.
  • Rubi's 1.2.1.6, 4.3.9 and 4.4.9 (217 problems): 200 → 202. One gain is this rule's, (A + B x)/((a e + b e x + b f x^2)^2 sqrt(d + e x + f x^2)), declined by master after 19 s and answered in 2.7 s. The other, x^2 (a + b x + c x^2)^(3/2)/(d - f x^2), timed out on master and took 20 s here, past the budget either way.
  • The families sample (912 problems) and family 0 (1814), on a build with this branch and three others merged, against dd728251: 793 → 804 and 1752 → 1753. Re-run on each branch alone, this branch's is family 0's Welz 43, (sqrt(x) - sqrt(x^2 - 1))^2/((1 + x - x^2)^2 sqrt(x^2 - 1)), declined by master after 9.8 s and answered in 0.6 s. None of the moves is a loss.

The unit tests pass on a build with this branch and two others of mine merged (net10.0, 13,685), and every target builds.

🤖 Generated with Claude Code

…s reduced a power at a time

P/(A^k sqrt(B)), two different quadratics and k at least two, was left
unevaluated, and so were Rubi's sqrt(a + a sec(x))/(c + d sec(x))^2 and its
kin, which the half-angle tangent writes as
(1 - t^2)^(3/2)/((1 + t^2)((c + d) + (d - c) t^2)^2). Over A^j, P is L + A R
with L linear; L/(A^j sqrt(B)) is the derivative of (p + q x) sqrt(B)/A^(j - 1)
plus S/(A^(j - 1) sqrt(B)) wherever 2 L = 2 q A B + (p + q x) W + 2 A S,
W = B' A - 2 (j - 1) B A'. The x^4 equation gives S2 = 2 q B2 (j - 2), the x^3
and x^2 ones S1 and S0 linear in p and q, and the x and constant ones are two
equations in p and q, solved by their determinant; the linear solver over the
symbols took 28 s on the five and failed. Down to the closed form over A, past
a bound on the coefficients' size declined. The secant rule hands its rational
function beside the root to the rule for it before the chain, whose
substitution search spent the budget ahead of it, and the split beside the
root drops a piece that is zero with a condition on it, which it asked for
and declined on.

Measured with work/intbench against dd72825, 3 s a problem: Rubi's 970 rows
with a half-odd power of a +- a sec or a +- a csc, 937 -> 946, none lost,
timeouts 13 -> 5, 328 s -> 200 s; 1.2.1.6, 4.3.9 and 4.4.9, 200 -> 202;
family 0, Welz 43, declined after 9.8 s, answered in 0.6 s.

Part of #718.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rafael-SOWNet
Rafael-SOWNet merged commit 21203a8 into master Sep 29, 2026
31 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