Skip to content

Integrate a symbolic power of a monomial on both sides of 0, for a constant of either sign - #2012

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
integrate-a-symbolic-power-of-a-monomial-on-both-sides
Oct 21, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
integrate-a-symbolic-power-of-a-monomial-on-both-sides

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #233. Fixes wrong answers.

DistributeAFractionalPower (SolveByDistributingAPowerOfAMonomial) wrote (c x^n)^b as c^b x^(n b). Its stated premise was that a symbolic n leaves the integrand real only for x > 0. That is false for an even n. At m = 2, (x^m)^p is real for every x, while x^(m p + 1)/(m p + 1) is its antiderivative on x > 0 only. The same defect gave wrong answers for:

  • (ln(a x^n)^m)^p/x, wherever the logarithm is negative (Rubi's 3.5:189 and 191);
  • (b x^m)^p;
  • (sin^m)^p cos, wherever the sine is negative;
  • Rubi's 4.3.0:73 and 4.3.7:46, 210–212 and 626–628, the (b tan^n)^(1/n) shapes, wherever the tangent is negative.

The harness does not see these, because its pins make m non-integer, so the integrand is complex where the base is negative and those points are skipped. They were found and checked at m = 2, p = 1/2 with mpmath, on both sides of 0.

Where n is symbolic and the power is a factor of the integrand, it is now written K x^(n b), with K = (c x^n)^b / x^(n b). K is constant wherever the power is continuous, for every c, n and b. It is integrated as a constant and written back. The answers become Rubi's, with no condition on c:

  • x (x^m)^p/(m p + 1);
  • ln(a x^n) (ln(a x^n)^m)^p/((m p + 1) n);
  • x (c x^n)^b/(b n + 1).

Inside a sum the old split is kept: K as a symbol there made a 568-character piecewise of 1/(1 + 4 (x^(2n))^(1/n)).

Measured with the probe against master a567c8b:

pocket master this
551 rows with a symbolic power of a power 527 OK, 12 WRONG 536 OK, 4 WRONG
family 3, 1,382 rows 2 WRONG, 1 UNVER 0 WRONG, 0 UNVER
6.1.x, 971 rows — no answer changes

The 4 remaining WRONG are the same rows on both builds: F^(f (a + b ln(...))^2), whose values at the probe's pins are 1e277 to 1e992, past the evaluator's range. The harness judges them Solved. In 1.1.3.2, 47 answers lose a provided b > 0.

Chain against master a567c8b, with the harness at its current revision on both arms:

  • pocket of 1,933 rows: allocation over those solved on both identical, 457.5 GB;
  • samples of families 0–8: unchanged;
  • the five 3.2.x rows that moved have identical allocation on both arms; they are borderline rows near 20 s.

Tests: a new class pinned at m = 2, p = 1/2 and at m = 2.3, p = 1.44, on both sides of 0. ExponentialOfALogarithmIntegralTest.APowerOfAMonomialIsDistributed, which pinned the old provided c > 0, now asserts no condition and checks c < 0 and x < 0 too.

One wrong answer remains, unchanged by this PR: 1/(1 + (x^n)^(1/n)) gives ln(x + 1), wrong at n = 2 for x < 0.

The BREAKING-CHANGES.md entry gives 2.5.0's answer, which was a decline for every input, and the unreleased master's.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…nstant of either sign

DistributeAFractionalPower wrote (c x^n)^b as c^b x^(n b), on the premise
that a symbolic n leaves the integrand real only for x > 0. That is false
for an even n: (x^m)^p at m = 2 is real for every x, and x^(m p + 1)/(m p
+ 1) is its antiderivative on x > 0 only. The same answer was wrong for
(ln(a x^n)^m)^p/x wherever the logarithm is negative, for (b x^m)^p, for
(sin^m)^p cos where the sine is, and for Rubi's 4.3.0 and 4.3.7
(b tan^n)^(1/n) shapes wherever the tangent is.

Where n is symbolic and the power is a factor of the integrand, it is now
written K x^(n b) with K = (c x^n)^b / x^(n b), constant wherever the power
is continuous for every c, n and b: K is integrated as a constant and
written back. The answers are Rubi's -- x (x^m)^p/(m p + 1),
ln(a x^n) (ln(a x^n)^m)^p/((m p + 1) n), x (c x^n)^b/(b n + 1) -- with no
condition on c. Inside a sum the old split is kept: K as a symbol there
made a 568-character piecewise of 1/(1 + 4 (x^(2n))^(1/n)).

On 551 rows with a symbolic power of a power: 12 wrong -> 4 (those four are
F^(f (a + b ln(...))^2), whose values pass the evaluator's range), checked
at m = 2, p = 1/2 against mpmath on both sides of 0. In 1.1.3.2, 47 answers
lose a `provided b > 0`. Chain against master a567c8b: pocket of 1,933
rows, allocation over those solved on both identical (457.5 GB); samples
unchanged; no other row moved.

Part of #233.

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 21, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 98821ed into master Oct 21, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Oct 21, 2026
Rafael-SOWNet added a commit that referenced this pull request Oct 21, 2026
…ower of u

The rule that reads an exponential's exponent P as the variable, beside its
derivative, wrote P as u only where it stood as written. Taking the leading
coefficient's power out of a power below the bar hands on
e^P P'/(P/c)^k, where P/c is another polynomial, so
e^(a + b x + c x^2) (b + 2 c x)/(a + b x + c x^2)^3 went on to the ansatz
and ran out of time, where it is e^u/u^3. A polynomial equal to k P
coefficient by coefficient is now read as k u, and a whole power of one as
the power of k times the power of u.

Rubi's 2.3: the cube, past 60 s on master f7f2a7a, is answered in 27 ms
(197 characters); the square, 14.4 s and 9.9 GB there, takes 0.3 s and
7 MB (114 characters, carrying a factor that is 1). 2.5.0 declined both.

Of the other 21 rows the branch's chain moved against 4877ed2, 18 answer
identically on master f7f2a7a and here, and 3 are declined or past 20 s on
both: #2005 and #2012 have since written the other mechanisms this branch
had, and those are not part of it any more.

Part of #233.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet added a commit that referenced this pull request Oct 21, 2026
…ower of u

The rule that reads an exponential's exponent P as the variable, beside its
derivative, wrote P as u only where it stood as written. Taking the leading
coefficient's power out of a power below the bar hands on
e^P P'/(P/c)^k, where P/c is another polynomial, so
e^(a + b x + c x^2) (b + 2 c x)/(a + b x + c x^2)^3 went on to the ansatz
and ran out of time, where it is e^u/u^3. A polynomial equal to k P
coefficient by coefficient is now read as k u, and a whole power of one as
the power of k times the power of u.

Rubi's 2.3: the cube, past 60 s on master f7f2a7a, is answered in 27 ms
(197 characters); the square, 14.4 s and 9.9 GB there, takes 0.3 s and
7 MB (114 characters, carrying a factor that is 1). 2.5.0 declined both.

Of the other 21 rows the branch's chain moved against 4877ed2, 17 answer
identically on master f7f2a7a and here, and 4 are declined or past 20 s on
both: #2005 and #2012 have since written the other mechanisms this branch
had, and those are not part of it any more.

Part of #233.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet added a commit that referenced this pull request Oct 21, 2026
…ower of u (#2020)

The rule that reads an exponential's exponent P as the variable, beside its
derivative, wrote P as u only where it stood as written. Taking the leading
coefficient's power out of a power below the bar hands on
e^P P'/(P/c)^k, where P/c is another polynomial, so
e^(a + b x + c x^2) (b + 2 c x)/(a + b x + c x^2)^3 went on to the ansatz
and ran out of time, where it is e^u/u^3. A polynomial equal to k P
coefficient by coefficient is now read as k u, and a whole power of one as
the power of k times the power of u.

Rubi's 2.3: the cube, past 60 s on master f7f2a7a, is answered in 27 ms
(197 characters); the square, 14.4 s and 9.9 GB there, takes 0.3 s and
7 MB (114 characters, carrying a factor that is 1). 2.5.0 declined both.

Of the other 21 rows the branch's chain moved against 4877ed2, 17 answer
identically on master f7f2a7a and here, and 4 are declined or past 20 s on
both: #2005 and #2012 have since written the other mechanisms this branch
had, and those are not part of it any more.

Part of #233.


Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Rafael-SOWNet added a commit that referenced this pull request Oct 21, 2026
… and a sine raised from nothing as a derivative (#2031)

- A sum of powers of one sine, cosine, secant or cosecant of a linear, the
  powers not whole and two apart, by the reduction formula from the highest
  down; each power alone is elliptic. Beside x, by parts once.
- The derivative of a sine raised from nothing times powers of the cosine
  and sums in it, or of a cosine beside the sine.
- A cosine beside a function of the sine with a power of it that is not
  rational, in s = sin(x).
- (c sin(a + b x)^n)^(1/n) as a constant times sin(a + b x) between the
  zeros of the sine, and so for the cosine.
- Under the homogeneous substitution, factors written alike on both sides
  cancelled; under the tangent, a whole power of a product distributed; and
  the root of 1 - cos(x)^2 beside a root of 1 - cos(x) as the product of
  the roots of 1 - cos(x) and 1 + cos(x).

Chain against master f7f2a7a: pocket of 2,005 rows, 1,979 -> 1,998 solved,
0 wrong; family 4's sample 1,025 -> 1,026, the others unchanged; the 19 rows that
moved, alone, 0 -> 19 solved; 7,510 rows compared for allocation, none grew
past 55 MB.

The new test that the power-of-x case is left to the rules before it pinned
`c > 0` in the answer to (c x^n)^(1/n), as those wrote it before #2012; master
writes x (c x^n)^(1/n)/2, whose derivative is the integrand on every branch
since d/dx (c x^n)^(1/n) = (c x^n)^(1/n)/x, and the test pins that.

Part of #233.


Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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