Skip to content

A polynomial or a power of x beside exponentials of quadratics without a linear part is integrated about 0 - #1524

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
moments-about-zero
Sep 28, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
moments-about-zero

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #1501. Follows #1521.

#1521 integrated a product of exponentials of quadratics beside a polynomial by taking each term's moments at its square's centre, u = x + b/(2a). Where a term's exponent has no linear part, that shift is 0/(2a). Simplified, that is 0 provided not a = 0, and substituted into the polynomial it is not read as zero, so the polynomial was not read as one. x^2 sinh(a + b x^2)^3 was declined that way, as #1521 said.

Such a term's moments are now taken about 0, from each power of x and its coefficient. A power of x is read apart from the polynomial, above or below the bar. Below it, it is a negative power, and a negative even power is a moment too: sinh(a + b x^2)^3/x^2 is answered. A negative odd power ends at the exponential integral, and is still declined.

A term with a linear part keeps the polynomial as the integrand writes it, and its moments at the centre are taken as #1521 took them.

The two comments in #1521 that recounted how its first version failed now say only why the code is written as it is.

integral master this PR
x^2 sinh(a + b x^2)^3, sinh(a + b x^2)^3/x^2 (Rubi's 6.1.3) unevaluated answered
cosh(a + b x^2)^3/x^4 answered, after 52 s answered, in 0.2 s
sinh(a + b x^2)^3/x unevaluated unevaluated: it ends at the exponential integral

Measured

Measured with the change on #1521's head before its merge (95361819), before the rebase onto #1520 and #1522. After the rebase, the library builds for every target, and the exponentials-of-quadratics, Gaussian and logarithm test classes pass (94).

  • Rubi's problems whose answer uses erf, erfc or erfi: 811 across families 0 to 7, at a 3 s budget. This PR solves 722, where Exponentials of quadratics beside sines, cosines and hyperbolic functions of quadratics are integrated onto the Gaussian #1521 solves 720, with 0 wrong and nothing lost. Both have the same 3 timeouts, and the total time goes from 298 s to 264 s. The 2 gained are the two in 6.1.3 above.
  • The textbook suites (family 0) are unchanged: 1723/1778, 0 wrong, 0 timeouts.
  • The unit suite passes on net10.0: 12970 passed, 14 skipped, none failed, of 12984. One of the new test's rows was then cosh(a + b x^2)^2/x^4, which another rule answers, in 10 s: the rule here declines it, since the constant term of cosh^2 beside x^(-4) is left to the power rule. That row is now cosh(a + b x^2)^3/x^4, whose terms are all moments about 0, and the class passes in under a second.
  • The allocation gate passes on all 19 gated benchmarks, with no allocation moved.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 2 commits September 28, 2026 00:37
…t a linear part is integrated about 0

In the product of exponentials of quadratics, a power of x is read apart
from the polynomial, above or below the bar, and a term whose exponent has
no linear part takes its moments about 0, where a negative even power is a
moment too. Taken at the square's centre instead, the shift b/(2a) is
0/(2a), which simplifies to 0 provided a is not 0; substituted into the
polynomial it is not read as one, and x^2 sinh(a + b x^2)^3 was declined.
Rubi's 6.1.3, x^2 sinh(a + b x^2)^3 and sinh(a + b x^2)^3/x^2.

Part of #1501.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
… one it follows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit 621a319 into master Sep 28, 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