(a + b asech(c x))/(d + e x)^2 is integrated, and a root written apart with |x| no longer needs a parity - #1459
Merged
Merged
Conversation
…t with |x| no longer needs a parity Rubi's 7.5.1 with a symbolic linear below the bar ran for ten minutes without an answer. Traced, by parts leaves 1/(x^2 (d + e x) sqrt(1/(c x)^2 - 1)), and four things stood between that and the answer Euler's substitution gives: - SolveAsPolynomialTerm handed a constant over a product on as the product to the power -1, which no radical rule reads; it is the reciprocal now, asked as the same question with the constant in front. - SolveByDistributingWholePowersOfProducts asked its respelling one level down, past the rules scoped to the question asked or one below it; (c x)^2 and c^2 x^2 are one integrand, and it is the same question. - SolveByWritingAPowerOfAQuotientApart, having written the root apart with |x| for x > 0 and found the antiderivative, declined it because the integrand has no parity to extend by; sgn(x)^m stands in for the extension where every power of x taken is a whole one, which is exact. - A root inside a logarithm's argument is left as written: the logarithm is an atom to every rule, and writing asech(c x)'s root apart re-asked the whole integrand for a second and a half of nothing. Rubi's family 7: 206 to 210 of 270, 0 wrong, timeouts 34 to 26, wall 1185 to 952 s; the 1774-problem suite 1706 to 1707 (Timofeev 944), 0 wrong, wall 87 s. Suite 12547 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
(a + b asech(c x))/(d + e x)^2ran for ten minutes without an answer (the numericasech(2 + 3x)/x^2next to it is 0.7 s). Traced with the dispatcher instrumented and a managed stack dump mid-runaway: by parts leaves1/(x^2 (d + e x) sqrt(1/(c x)^2 − 1)), Euler's substitution answers that in 15 ms, and four things stood between the two.SolveAsPolynomialTerm'sc/g(x)branch handedpe/(x (d + e x) sqrt(…))on aspe · (x (d + e x) sqrt(…))^(−1), a spelling no radical rule reads (its own comment says so, for the rational rules); it is1/(…)now, asked as the same question with the constant in front. The1/g(x)case keeps the power, since1/gasked again would be the same call.SolveByDistributingWholePowersOfProductsasks its respelling as the same question.(c x)^2andc^2 x^2are one integrand, and one level down the remainder sat pastSolveByWritingAPowerOfAQuotientApart's "question asked or one below" scope — which is what answers it.sgn(x)^mwhere the parity extension fails. The quotient-apart route writessqrt(1/(c x)^2 − 1)assqrt(1 − c^2 x^2)/(|c| |x|)and answers forx > 0, then extends by parity — and1/(x^2 (d + e x) sqrt(…))has none, so the antiderivative it had just found was declined.|x|^missgn(x)^m x^mfor a wholem, exact on each half-line, and that stands in for the extension now where every power ofxtaken is whole (a fractional|x|^(1/2)still needs the parity).asech(c x)'s own root apart re-asked the whole integrand for 1.5 s of nothing.Measured:
(a + b asech(c x))/(d + e x)^2590 s+ → 1.1 s;(a + b asech(c x))/x^79 s timeout → 0.09 s;e^(2 asech(a x))/x^2unevaluated → 0.07 s;x (a + b asech(c x))/(d + e x^2)^22.7 → 1.0 s.BREAKING-CHANGES.mdentry with the 2.5.0 column measured on a build of v2.5.0 (all four left unevaluated there).Tests: four rows in
InverseHyperbolicSecantIntegralTest, each differentiated back against the integrand at five real points witha, b, c, d, epinned.Part of #718.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura