Skip to content

Powers of asech(a x) and acsch(a x) beside a power of x are integrated, by rounds of parts - #1460

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
asech-powers
Sep 22, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
asech-powers

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Rubi's 7.5.1 and 7.6.1 with a power of the secant or cosecant: x^3 asech(a x)^2, asech(a x)^3/x^2, (a + b acsch(c x))^2/x^4 and their kin. One step of parts leaves x^2 asech(a x)/sqrt(1/(a x)^2 − 1), and the step on that — two levels below the question — was never offered. Traced, five things, each fixed in its place:

  • The by-parts regrouping around the differentiated factor is offered up to two levels below the question where everything beside the factor is algebraic with a root in it: the other factor integrates to an algebraic expression or declines at once, and the remainder is algebraic — none of the logarithms by the dozen the existing top-only scope is there to stop. With a root only: beside a rational function the rule for a rational function times a logarithm answers, and offering parts there sent (a + b atanh(c x^2))^2/x^5 into a search that did not return (measured, and why the guard says root).
  • SolveByWritingAPowerOfAQuotientApart runs at any depth where every root stands over a monomial with a polynomial above itsqrt(1/(a x)^2 − 1) as the derivative of asech writes it — and answers with sgn(x)^m in front rather than by parity: the parity extension wrote its answer in |x|, and handed on by the next step that was a remainder in |x| and (1 − (|x| a)^2) no rule read. The sign goes in front only where every power of |x| taken came from a root that is a factor of the integrand (a root inside a sum keeps the parity extension). A first version required the monomial only, without the polynomial above — (1 + ln(u^2)/u^2)^(−3/2) qualified, and Bronstein's sqrt(x + ln x) row went from 0.9 s to 10.
  • SolveByTakingASignOut: the sign of a real-valued factor is constant between its zeros and goes in front of the antiderivative of the rest (the generic case every rule answers in; sgn(g) for a complex g is g/|g| and is not taken). Placed after every rule that reads the sign where it stands, so cos(x) sgn(sin(x)) is still |sin(x)| and the five pinned IntegrationTest rows keep their forms.
  • A radicand written in two orders is one spelling where it stands in two places that differ in the sign of the power or the side of the bar — q^(−1/2) above beside sqrt(q) below, or sqrt(A) above beside sqrt(A′) below — extending asech(a + b x) and acsch(a + b x) beside a power of x are integrated #1457's rule, which read the written sign only and missed the second shape (sqrt(1 − x^2 a^2)/(sqrt(1 + −a^2 x^2) x) was a 49,000-try search).
  • A whole power of a fractional power is normalised to the power it is: ((c^2 x^2 + 1)^(−1/2))^2 is (c^2 x^2 + 1)^(−1), and left as a square of a root it was handed to Euler's substitution as a radical beside (c^2 x^2 + 1)^(−1), which answered the remainder of acsch(c x)^2/x^4 wrongly — the first corpus run of this branch had it as its one wrong answer (derivative off by 0.02%), and the piece was found by differentiating the answer's two parts separately. A fractional inner power only: flattening ((1 + x^2)^(−1))^4 too sent Timofeev's x^3 arctan(x)^2/(1 + x^2)^3 from 0.1 s to 8.

Measured:

  • x^3 asech(a x)^2 5 s decline → 0.3 s; asech(a x)^2/x^2 60 s runaway → 0.5 s; asech(a x)^3/x^2 3 s decline → 0.8 s; (a + b asech(c x))^2/x^4 8 s decline → 0.4 s; (a + b acsch(c x))^2/x^4 7 s decline → 0.5 s; x^3 (a + b acsch(c x))^2 20 s → 0.9 s.
  • Family 7: 210 → 215 of 270, 0 wrong, 0 error (7.5.1:11/25/53, 7.6.1:26/33); timeouts 26 → 30 are rows over the 5 s budget either way.
  • The 1774-problem suite: unchanged, 1707/1774, 0 wrong, 0 timeout, wall 85 s; per-problem, nothing moved by more than 0.2 s (Timofeev 950 is 2 s faster).
  • Full suite 12552 passed, 0 failed; the kernel gate PASSED on all 19 gated benchmarks. BREAKING-CHANGES.md entry with the 2.5.0 column measured on a build of v2.5.0.

Tests: five rows added to InverseHyperbolicSecantIntegralTest, each differentiated back and compared numerically at five real points with the parameters pinned.

Part of #718.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

…d, by rounds of parts

x^3 asech(a x)^2 was left as written. One step of parts leaves
x^2 asech(a x)/sqrt(1/(a x)^2 - 1), and five things stood between that and
the next step, each traced and fixed in its place:

- The regrouping of parts around the differentiated factor is offered up to
  two levels below the question asked where everything beside the factor is
  algebraic with a root in it: the other factor integrates to an algebraic
  expression or declines at once, and the remainder is algebraic. With a root
  only, since beside a rational function the rule for a rational function
  times a logarithm answers, and parts there sent (a + b atanh(c x^2))^2/x^5
  into a search that did not return.
- SolveByWritingAPowerOfAQuotientApart runs at any depth where every root
  stands over a monomial with a polynomial above it -- sqrt(1/(a x)^2 - 1) as
  the derivative of asech writes it -- and answers with sgn(x)^m in front
  rather than by parity, where the answer in |x| was a remainder no rule read
  when handed on. The sign goes in front only where every power of |x| taken
  came from a root that is a factor of the integrand.
- SolveByTakingASignOut: the sign of a real-valued factor is constant between
  its zeros and goes in front of the antiderivative of the rest; after every
  rule that reads the sign where it stands, so cos(x) sgn(sin(x)) is still
  |sin(x)|.
- A radicand written in two orders is one spelling where it stands in two
  places that differ in the sign of the power or the side of the bar.
- A whole power of a fractional power is normalised to the power it is:
  ((c^2 x^2 + 1)^(-1/2))^2 handed to Euler's substitution as a radical beside
  (c^2 x^2 + 1)^(-1) answered the remainder of acsch(c x)^2/x^4 wrongly, and
  the corpus caught it as its one wrong answer.

Rubi's family 7: 210 to 215 of 270, 0 wrong, 0 error, timeouts 26 to 30
(the same rows, over the budget under the load of the new answers); the
1774-problem suite unchanged at 1707, 0 wrong, 0 timeout, wall 85 s. Suite
12552 passed; the kernel gate passed on all 19 gated benchmarks.

Part of #718.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit 01a944f into master Sep 22, 2026
31 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the asech-powers branch September 22, 2026 03:28
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