Skip to content

Reduce a rational function over a power of a symbolic quadratic a power at a time - #1891

Merged
Rafael-SOWNet merged 4 commits into
masterfrom
a-rational-function-over-a-power-of-a-symbolic-quadratic-is-reduced
Oct 15, 2026
Merged

Rafael-SOWNet merged 4 commits into
masterfrom
a-rational-function-over-a-power-of-a-symbolic-quadratic-is-reduced

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718

1/((d + e x)(a + b x + c x^2)^4), x^8/(a + b x + c x^2)^4 and their kin in Rubi's 1.2.1 ran past a minute. The partial fractions take a symbolic quadratic apart over its roots, and its powers with it. The new SolveARationalFunctionOverAPowerOfASymbolicQuadratic never takes the quadratic apart:

  • The linear comes off at its root p. Using Q - Q(p) = (x - p)(c (x + p) + b), N/(L^j Q^k) becomes N(p)/(Q(p)^k L^j), plus short polynomials over lower powers of L and Q. The terms are kept in a worklist keyed by those two powers, so each stays of small degree.
  • The power of the quadratic is lowered one at a time. P = S Q + alpha Q' + beta, alpha Q'/Q^k integrates directly, and beta/Q^k follows the recurrence integral 1/Q^k = (2 c x + b)/((k - 1) D Q^(k - 1)) + 2 c (2 k - 3)/((k - 1) D) integral 1/Q^(k - 1), with D = 4 a c - b^2.
  • The first power is written in closed form, as alpha ln Q plus beta times the table's integral 1/Q.
  • D, Q(p) and p are named atoms while it runs, and the answer is checked by its derivative.

It applies to the question asked only, with one linear at most. It declines in three cases, each of which a chain caught:

Declines when What happened without it
b^2 - 4 a c is a polynomial square, so the quadratic factors over linears 1.2.1.2:2145 was lost; 1/(x^2 (d + e x)^4 (d^2 - e^2 x^2)^(7/2)) went from 943 characters to 22K
the coefficients hold the imaginary unit TrigonometricOfAnImaginaryLogarithmIntegralTest failed
Q has no x term and there is no linear (a binomial in x^2) x^22/(a + b x^2)^10 ran past the budget

Measured

intbench, this branch against master 37b4798, 5 s budget. The pocket was 1.2.1.2–1.2.1.4, 1.2.1.9, 1.3.1, 1.2.2.2 and 1.2.2.3 in full (7,020 rows), plus the usual family sample:

master this branch
pocket 6,940 solved, 28 timeouts 6,947 solved, 21 timeouts
time on the rows both solve 1,379 s 1,339 s
rows more than twice as slow none
families 0–8 sample identical
wrong / error 0 / 0 0 / 0

Seven rows moved, all to solved, and all held when re-run alone (master solves none of them):

  • 1.2.1.2: 611, 2505, 2514, 2522 and 2523
  • 1.2.1.3:2704
  • 1.2.1.9:84

Every new answer was checked exactly with exactcheck (exact pins, 50 and 2,000 digits, four points, three pin sets): 192 of 192 diff 0. The gate and the suite pass (15,401).

The answers are 8.5K to 26K characters, in under 0.4 s each. Much of the length is the table's integral 1/Q, which is a piecewise on the sign of the discriminant.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 4 commits October 15, 2026 05:55
… a time

A rational function over a whole power of a symbolic quadratic, beside at
most one linear, is taken apart at the linear's root -- through
Q - Q(p) = (x - p)(c (x + p) + b), so that every piece stays a short
polynomial over a power of L and of Q -- and the power of the quadratic is
lowered by the recurrence for the integral of 1/Q^k, down to the first,
which is written in closed form. The discriminant, Q(p) and p are named
while it runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…partial fractions

b^2 - 4ac a square is a quadratic over two linears, which the partial
fractions take apart cheaply: (d + e x)^10/((d + e x)(a e + c d x))^4 went
from 2 seconds past the budget here. And below a substitution the routes
this pre-empts answered shorter.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…e rules before

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 15, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 1fce7d8 into master Oct 15, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant