Skip to content

A function of x^n for a symbolic n beside a power of x is integrated in a power of x - #1784

Merged
Rafael-SOWNet merged 4 commits into
masterfrom
a-function-of-x-to-a-symbolic-power-is-integrated-in-that-power
Oct 5, 2026
Merged

Rafael-SOWNet merged 4 commits into
masterfrom
a-function-of-x-to-a-symbolic-power-is-integrated-in-that-power

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

x^(-1 + 4n)/(a + b x^n + c x^(2n)) and the rest of Rubi's 1.2.3.2 functions of x^n beside a power x^m with (m + 1)/n rational were declined. The substitution search reads x^(2n) as a power of x^n only for a number n, and offers nothing for x^(n/2), which is not written:

integrand 2.5.0 master 2b86349c this
x^(-1 + 4n)/(a + b x^n + c x^(2n)) declined declined 1,225 characters
1/(x (a + b x^n + c x^(2n))) declined declined 869 characters
x^(-1 + n/2)/(a + b x^n + c x^(2n)) declined declined 381 characters
sqrt(a + b x^n + c x^(2n))/x declined declined 2,181 characters
1/(x (a^2 + 2 a b x^n + b^2 x^(2n))^(3/2)) declined 259 characters 265 characters

Each answer is differentiated back and compared with the integrand at six points.

What changes. SolveByAPowerOfXWithASymbolicExponent, asked before the substitution search, writes x f(x) over one bar with its powers of x gathered, x x^(-1 + 4n) as x^(4n). It takes u = x^(n/d), n the simplest symbolic exponent left and d the first of 1, 2, 3, 4 and 6 at which every power of x is a whole power of u. A whole power of u is the same function of x on either side of 0, and dx/x = (d/n) du/u, so the integral is d/n times that of g/u in u, written back.

  • An algebraic function of the powers only. Under a function the power of x is the function's, and the search finds the substitution for it: coth(a + b ln(c x^n))^3/x is t = ln(c x^n).
  • Each constant atom with a symbol in it named, e^a and c^b, while the integral in u is asked, and written back into it. coth(a + b ln(c x^n))^3/x reaches the rule all the same, through the exponential form of coth, as a rational function of x^(2 n b) with (e^a)^2 (c^b)^2 in it; carried through the partial fractions as written that constant took over half a minute, and as k^2 m^2 it takes under one. Atoms and not whole coefficients, which would hide what relates them: a^2 + 2 a b u + b^2 u^2 stays a perfect square.

Tests: PowerOfXWithASymbolicExponentIntegralTest, six rows of 1.2.3.2 differentiated back, one of them the perfect square; and coth(a + b ln(c x^n))^3/x and the hyperbolic tangent's, which take over half a minute with the constant carried as written: a time cannot be held in a test, and a regression shows as one that crawls.

Measured first on 935 problems, 549 of them Rubi's 1.2.3.2 and most of the rest from its 1.1.3 and 1.2.3, about half with a symbolic exponent, at the corpus's 5-second budget, against master 287c69a7, the branch's base:

master this
solved 833 879
wrong 0 0
past the budget 7 7

Measured then on the Rubi corpus against master 287c69a7:

master this
family 0, independent suites (1814) 1772 1772
family 1, 40 a file (1381) 1308 1309
families 2 to 8, sampled (2410) 2301 2300

The harness counts no answer wrong in either. The 50 problems the two builds disagreed on, pocket and sample together, run again one build at a time: this answers 45 that master does not, all of 1.1.3.2 and 1.2.3.2, and three more are past 20 seconds on both builds. Master answered one this did not: 6.4.2's coth(a + b ln(c x^n))^3/x, in 0.1 s, where this went past the budget. With the constants named and the rule kept to algebraic integrands, db4510ca, it is answered in 0.9 s, and the pocket run again gives each of its 935 problems the verdict it had.

The suite passes on the commit measured, 7d336105, 14,805 tests. The allocation gate failed on it at SolveEasyMedium: 27 times the baseline's time and 2.3% more allocation, where every other branch measured that day allocated what the baseline says. On 8c35d4c2, which names the constants and merges master f6e1e308, the gate passes, SolveEasyMedium at the baseline's allocation exactly and 1.27 times its time with corpus runs on the machine, and the suite passes, 14,987 tests; the library builds for netstandard2.0. The head here, 01d78201, merges master 91149594; the calculus and corpus tests pass on it but for two that hold a wall clock, IntegralAnswerCacheTest.AnIntegralWithNoAnswerStillFinishesQuickly and InverseTangentPowerByPartsTest.ANonElementaryRemainderIsDeclinedQuickly, past their bounds with other test runs and corpus runs on the machine; run alone they take what they take on master, 7 to 13 seconds against 9 to 13.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 4 commits October 5, 2026 02:33
…in a power of x

x^(-1 + 4n)/(a + b x^n + c x^(2n)) and the rest of Rubi's 1.2.3.2 functions of x^n
beside a power x^m with (m + 1)/n rational were declined: the substitution search
reads x^(2n) as a power of x^n only for a number n, and offered nothing for
x^(n/2), which is not written. Under u = x^(n/d) every such power is a whole power
of u, and dx/x is (d/n) du/u.

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

coth(a + b ln(c x^n))^3/x was answered in a second and timed out: the
exponential form of coth makes it a rational function of x^(2 n b) with
(e^a)^2 (c^b)^2 in it, and the integral in u carried that constant through
the partial fractions for over half a minute. Each constant atom with a
symbol in it, e^a and c^b, is named for the integral in u and written back,
which keeps what relates the coefficients: a^2 + 2 a b u + b^2 u^2 stays a
perfect square. And a power of x under a function is the function's, which
the search reads.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…a-symbolic-power-is-integrated-in-that-power
…a-symbolic-power-is-integrated-in-that-power
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 5, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit d92add5 into master Oct 5, 2026
34 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the a-function-of-x-to-a-symbolic-power-is-integrated-in-that-power 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