Repository navigation
Answer a half-angle integrand through two roots where the cosine is negative too - #1959
Merged
Rafael-SOWNet merged 1 commit intoOct 20, 2026
Conversation
…egative too The half-angle rule beside a half-odd power of `1 ± sec` writes each root of a constant times the secant or cosine apart in t = tan(y/2). That is exact where cos(y) > 0. Beyond it each root turns its sign by its constant's, and two roots make the integrand real on both sides at once, so the answer said `provided cos(y) >= 0`: half of the integrand's domain, for every one of the 165 rows of Rubi's 4.5.4.2 that took the rule. Which roots turn is known from their constants. For an even number of roots, the turns multiply to (-1)^n s, where n is the number of roots of the cosine and s is the sign of the product of the constants, and the integrand is real just where s > 0. The answer now holds there as written, with `sgn(cos(y))` in front for an odd n, and says `provided a > 0 or cos(y) >= 0` only where s is not known. An odd number above one still says `provided cos(y) >= 0`. Part of #233. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet
added a commit
that referenced
this pull request
Oct 20, 2026
…#1967) The half-angle rule beside a half-odd power of 1 ± sec writes each root of a constant times the secant or cosine apart in t = tan(y/2). For N roots, n of them of the cosine, with s the sign of the product of their constants: where the cosine is negative the turns multiply to (-1)^(N+n) s, the integrand is real there exactly where (-1)^N s > 0, and there the turns are (-1)^n. #1959 used this for an even N. For an odd N the root of 1 - t^2 stays in the answer in t, which is kept beyond t^2 < 1 only where its derivative holds there at sampled points of both signs. With the cosine's sign in front where n is odd, it holds on the whole real domain. Where s is not known the condition is now `provided <product> < 0 or cos(y) >= 0`. The cosecant takes the same path through the complement, with sgn(sin(y)). sqrt(-1 - sec(x)) sqrt(sec(x)) sqrt(cos(x)), real only where the cosine is negative, had no value anywhere it is real. No Rubi row has an odd root count above one, and the answers to every fair row of Rubi's 4.5 and 4.6 (2,966 rows, 1,317 of them with roots) are byte-identical. Part of #233. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
The half-angle rule beside a half-odd power of
1 ± sec(y)(#1584, after 2.5.0) writes each root of a constant times the secant or the cosine apart int = tan(y/2). That holds wherecos(y) > 0. Beyond that, each root turns its sign by its constant's, while two roots make the integrand real on both sides. So an answer through two roots saidprovided cos(y) >= 0: correct, but silent on half of the integrand's real domain.Which roots turn is known from their constants. For an even number of them, the turns multiply to
(-1)^n s, where n is the number of roots of the cosine and s is the sign of the product of the constants. The integrand is real exactly wheres > 0. The answer now holds there as written, withsgn(cos(y))in front when n is odd. It saysprovided a > 0 or cos(y) >= 0only where the sign of s is not known. An odd number of roots above one still saysprovided cos(y) >= 0.Probed at points on both sides of the cosine's zeros, 381 of the 481 two-root rows of Rubi's 4.5 go from an answer missing there to one that differentiates back everywhere the integrand is real. None got worse.
Measured on
8a1ef454, branch against master. intbench already counted these rows as solved from the side where the answer held, so the counts do not move:The two moves are 3.2.1:292 and 7.4.1:369. Both time out on both builds when re-run alone. No run had a wrong answer.
OnePlusASecantHalfPowerIntegralTestchecks both signs of the cosine and of the constants; 13 of its cases fail on the old rule. InLinearRadicalSubstitutionIntegralTest, two cases that asserted the old condition now accept a right value or none beyond it, with the reason in their comments. The rule's unreleasedBREAKING-CHANGES.mdentry is amended.Part of #233.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura