Skip to content

A constant of integration is matched to a linear divisor with a symbol in it - #1642

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-constant-matched-to-a-symbolic-linear
Oct 1, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-constant-matched-to-a-symbolic-linear

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

By parts against a polynomial chooses the polynomial's antiderivative so that what the other factor's derivative divides by divides it too. Against x ln(1 + x), the antiderivative of x is (x^2 - 1)/2, and the remainder is a polynomial. That was done only where the division left a number over. a + b x leaves a symbol: x^2/2 over a + b x leaves a^2/(2 b^2). So x Shi(a + b x)^2 kept x^2/(a + b x) in its remainder, and nothing read it.

The antiderivative less its value at the root -a/b is divisible by the linear, and it is now written as the linear times the quotient. The linear then cancels as written, and x Shi(a + b x)^2 and x Ei(a + b x)^2 are two rounds of parts each, as x Shi(b x)^2 is (#1639).

A number left over is read as before, so the constant changes only for a linear divisor with a symbol in it. The answers it touches are special functions of a + b x beside a power of x: x Ei(a + b x) reads Ei(a + b x) (a + b x)(x/(2b) - a/(2b^2)) - ..., the same function as before.

Measured

Input Was (2.5.0) Now
"x*Shi(a+b*x)^2".Integrate("x") a ^ 2 * Shi * x ^ 2 / 2 + a * b * 2 * Shi * x ^ 3 / 3 + b ^ 2 * Shi * x ^ 4 / 4 + C, with Shi a variable an antiderivative in Shi(a + b x) and Ei(2 (a + b x)), Ei(-2 (a + b x))
"x*Ei(a+b*x)^2".Integrate("x") a ^ 2 * Ei * x ^ 2 / 2 + a * b * 2 * Ei * x ^ 3 / 3 + b ^ 2 * Ei * x ^ 4 / 4 + C, with Ei a variable an antiderivative in Ei(a + b x) and Ei(2 (a + b x))
  • Rubi, master at 6c94652f and this change on it, run side by side, 0 wrong everywhere:
    • Family 8: 373 → 376 of 420. The three are x Ei, x Shi and x Chi of a + b x, squared.
    • Family 2: 544 of 650 on both.
    • The independent suites: 1756 of 1814 on both.
    • Families 1 and 3–7 at five a file: 800 of 897 on both.
  • Run alone, the three are 0 of 3 on master and 3 of 3 here. The fourth problem that moved, 2.3 Issue 619 Bug: Solving a system of equations... #622, is 22 s unevaluated on both.
  • The unit tests pass: 14,259, none failed (net10.0). On master with A Gaussian below the bar is read as its negated exponent above it #1641 the classes this touches pass (136), and the native AOT publish of the C++ wrapper builds with no trim or AOT warnings.
  • The performance gate passes on d480366e, which is this change on 6c94652f. Allocation matches the baseline on all 19 gated benchmarks.

SpecialFunctionsByPartsTest has two rows with a shifted argument, each differentiated back with its parameters pinned.

Still declined, 18 problems of family 8's shifted squares:

  • Alone: Shi(a + b x)^2, Si(a + b x)^2, and erf, erfc and erfi of a + b x squared.
  • Beside x: x Si(a + b x)^2 and x Ci(a + b x)^2.
  • Beside x^2: Ei, Shi, Chi, Si and Ci of a + b x squared.
  • Beside (c + d x) and (c + d x)^2: the error functions of a + b x squared.

The term-by-term asking of #1639 is held to a multiple of x, and these need it, or the polynomial divided by the linear first.

Part of #1501.

🤖 Generated with Claude Code

…l in it

By parts against a polynomial chooses the polynomial's antiderivative so that what the other
factor's derivative divides by divides it too: against x ln(1 + x) the antiderivative of x is
(x^2 - 1)/2, and the remainder is a polynomial. That was done where the division left a number
over, and a + b x leaves a symbol: x^2/2 over a + b x leaves a^2/(2 b^2), so x Shi(a + b x)^2 kept
x^2/(a + b x) in its remainder and nothing read it. The antiderivative less its value at the root,
-a/b, is divisible by the linear, and it is written now as the linear times the quotient, so that
the linear cancels as written: x Shi(a + b x)^2 and x Ei(a + b x)^2 are two rounds of parts each.

Measured on the Rubi corpus, master at 6c94652 and this change on it, run side by side: family 8
373 -> 376 of 420 (x Ei, x Shi and x Chi of a + b x, squared); family 2 544 of 650, the independent
suites 1756 of 1814 and families 1 and 3 to 7 at five a file 800 of 897, on both. 0 wrong
everywhere. Run alone, the three are 0 of 3 on master and 3 of 3 here; the fourth problem that
moved, 2.3 #622, is 22 s unevaluated on both. The unit tests pass, 14,259.

The performance gate passes on d480366e, which is this change on 6c94652: allocation is what the
baseline says on all 19 gated benchmarks.

SpecialFunctionsByPartsTest has two rows with a shifted argument, each differentiated back with its
parameters pinned.

Part of #1501.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 1, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 16203aa into master Oct 1, 2026
31 checks passed
Rafael-SOWNet added a commit that referenced this pull request Oct 1, 2026
… term (#1643)

#1639 asked the remainder of a special function's square term by term only for an argument b x.
For a + b x, the remainder divided by the linear, and its terms were the exponentials a hyperbolic
function is written as, each a harder question than the whole. With the constant of integration
matched to the linear (#1642), the linear cancels and the terms are the case without the offset,
so the asking is offered for any linear argument now. The exception is an error function beside
anything but itself. Its derivative is a Gaussian of the shifted argument rather than a quotient by
it, so a polynomial beside it stays in every term: asking them took the decline of
(c + d x) erf(a + b x)^2 from six seconds to twenty-four, and answered nothing.

Measured on the Rubi corpus, master at 16203aa and this change on it, run side by side: family 8
380 -> 394 of 420, 0 timeout (erf, erfc and erfi of a + b x squared; Si and Ci of a + b x squared
beside x and x^2; Ei, Shi and Chi of a + b x squared beside x^2; Shi(a + b x)^2 and Si(a + b x)^2;
x^2 Ci(a + b x) cos(a + b x) and x^2 cos(a + b x) Si(a + b x)); family 2 544 of 650, the independent
suites 1756 of 1814 and families 1 and 3 to 7 at five a file 800 of 897, on both. 0 wrong
everywhere. Run alone, the fourteen are 0 of 14 on master and 14 of 14 here. Measured the same way
with the error functions not excepted, family 8 was the same 394 with six timeouts more, and
families 0 to 7 moved nowhere. The unit tests pass, 14,265, and the performance gate passes on
ec42a120: allocation is what the baseline says on all 19 gated benchmarks.

SpecialFunctionsByPartsTest has four more rows with a shifted argument, each differentiated back
with its parameters pinned.

Part of #1501.

Co-Authored-By: Claude Opus 5.5 <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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant