Powers of asech(a x) and acsch(a x) beside a power of x are integrated, by rounds of parts - #1460
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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^4and their kin. One step of parts leavesx^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:(a + b atanh(c x^2))^2/x^5into a search that did not return (measured, and why the guard says root).SolveByWritingAPowerOfAQuotientApartruns at any depth where every root stands over a monomial with a polynomial above it —sqrt(1/(a x)^2 − 1)as the derivative ofasechwrites it — and answers withsgn(x)^min 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'ssqrt(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 complexgisg/|g|and is not taken). Placed after every rule that reads the sign where it stands, socos(x) sgn(sin(x))is still|sin(x)|and the five pinnedIntegrationTestrows keep their forms.q^(−1/2)above besidesqrt(q)below, orsqrt(A)above besidesqrt(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).((c^2 x^2 + 1)^(−1/2))^2is(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 ofacsch(c x)^2/x^4wrongly — 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))^4too sent Timofeev'sx^3 arctan(x)^2/(1 + x^2)^3from 0.1 s to 8.Measured:
x^3 asech(a x)^25 s decline → 0.3 s;asech(a x)^2/x^260 s runaway → 0.5 s;asech(a x)^3/x^23 s decline → 0.8 s;(a + b asech(c x))^2/x^48 s decline → 0.4 s;(a + b acsch(c x))^2/x^47 s decline → 0.5 s;x^3 (a + b acsch(c x))^220 s → 0.9 s.BREAKING-CHANGES.mdentry 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