Repository navigation
Half-odd powers of a ± a sec and a ± a csc by the half-angle tangent - #1584
Merged
Merged
Conversation
Rubi's (a + b sec)^m (d sec)^n files with a^2 = b^2 have about a thousand problems with a half-odd m, and sqrt(1 + sec(x)) was declined with the rest: the half angle at which a + a cos(y) is a square leaves a root of the cosine below the bar here, since 1 + sec(y) is that square over cos(y). Under t = tan(y/2), 1 + sec(y) is 2/(1 - t^2), 1 - sec(y) is -2 t^2/(1 - t^2) and sec(y) is (1 + t^2)/(1 - t^2), so beside powers of the secant and anything rational in the sine and cosine the whole is a rational function of t beside one root, of 1 - t^2 or of 1 + t^2; both at once is elliptic and declined before the chain is asked. The powers of the two quadratics and of t are gathered to one each, so that they cancel: left as written, sec(y) beside dy reached the rules in t as (1 + t^2)^0. The identities hold where the integrand is real, for either sign of a; the root of 1 - sec(y) carries sgn(tan(y/2)), constant between its zeros. The cosecant's the same way through the complement, csc(y) = sec(pi/2 - y). Measured with work/intbench against a8a2b7e, 3 s a problem, on a build with the rest of its batch: Rubi's 970 rows with a half-odd power of a +- a sec or a +- a csc, 165 -> 937 solved, 769 of the 772 gains by this alone, none lost, and 0 wrong against master's 7, in 332 s instead of 1514 s. Twelve declines with (c + d sec)^2 or ^3 below the bar now run past the budget. Over the families sample (912 problems) and family 0 (1814), 12 more gained by this alone, none lost. Part of #718. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
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.
Part of #718: half-odd powers of
a ± a sec(y)anda ± a csc(y), Rubi's(a + b sec)^m (d sec)^nfiles witha^2 = b^2, by the half-angle tangent.About a thousand of Rubi's problems in 4.5.1 to 4.5.4 and 4.6.1 have a half-odd power of
a ± a secora ± a csc. Master answered 165 of the 970 the harness can state, seven of them wrongly, andsqrt(1 + sec(x))was declined. The half angle at whicha + a cos(y)is a square does not reach them, since1 + sec(y)is that square overcos(y)and a root of the cosine is left below the bar.The substitution. Under
t = tan(y/2):1 + sec(y) = 2/(1 - t^2);1 - sec(y) = -2 t^2/(1 - t^2);sec(y) = (1 + t^2)/(1 - t^2), and everything else rational in the sine and cosine is rational int.So the integrand is a rational function of
tbeside one root, of1 - t^2or of1 + t^2, and the rules for a rational function beside a root of a quadratic answer it. A half-odd power of the secant beside a whole power of1 ± secleaves roots of both quadratics. That is elliptic, and it is declined before anything is asked. The powers of the two quadratics and oftare gathered to one each before the check and before the chain, so that they cancel: left as written,sec(y)besidedyreached the rules intas(1 + t^2)^0, which none reads.Where it holds.
a (1 + sec(y))is not negative withtinside(-1, 1)for a positivea, and outside it for a negative one. Either way(2a/(1 - t^2))^pis(2a)^p (1 - t^2)^(-p)for the principal powers, and the same holds for a power of the secant beside it. For1 - sec(y)the squaret^2comes out of the root as|t|, andsgn(tan(y/2)), constant between its zeros, goes in front. Outside(-1, 1)a root whose radicand is negative is imaginary. One alone leaves the integrand complex there, where the answer has nothing to be wrong about. Two can make it real again:(1 + sec(x))^(5/2) sqrt(cos(x))is real where the cosine is negative, and there each root written apart may have turned its sign where the other did not. So an answer through two roots saysprovided cos(y) >= 0, which is where it was checked.LinearRadicalSubstitutionIntegralTest.TheSearchsEvenRootSaysWhereItHoldspins exactly that for this integrand, and it failed here until the condition went in. The cosecant's the same way through the complement,csc(y) = sec(pi/2 - y), witht = tan(pi/4 - y/2). Scoped to the question asked or one below it, since it lands on the chain int.sqrt(1 + sec(x))integral(...)tan(x/2)sec(x)/sqrt(a + a*sec(x))integral(...)2 arcsin(tan(x/2))/sqrt(2a)1/(sec(x)^(3/2)*sqrt(1 + sec(x)))integral(...)1 + tan(x/2)^2sqrt(a - a*sec(x))integral(...)tan(x/2), timessgn(tan(x/2))sqrt(1 + csc(x))integral(...)tan(pi/4 - x/2)OnePlusASecantHalfPowerIntegralTestdifferentiates fifteen integrands back with the symbols pinned, at points where each is real.Measured with
work/intbenchagainst master ata8a2b7e7, the commit this is cut from, 3 s a problem, on a build with the other five branches of this batch merged beside it. Every moved problem was then re-run on this branch alone:a ± a secora ± a csc(970 problems in 4.5.x and 4.6.x): 165 → 937 solved, none lost, 0 wrong against master's 7. This branch alone makes 769 of the 772 gains: 4.5.1.2 126, 4.5.1.4 37, 4.5.2.1 111, 4.5.2.3 98, 4.5.3.1 124, 4.5.4.2 265, 4.6.1.2 8. The other three also need the rule for a linear over a quadratic beside a root (A linear over a quadratic beside the root of another, in closed form #1583), since ac + d secbelow the bar becomes a quadratic int. Timeouts fall from 173 to 13, and the rows take 332 s instead of 1514 s.sqrt(cos(c + d x))beside a half-odd power ofa + a sec(c + d x), with or withoutA + B sec. Where the cosine is negative, both roots are imaginary and the integrand is real, and master's answer is not an antiderivative there. Through this rule they are answered withprovided cos(c + d x) >= 0. Master's route for them, and why its answer is negated there, is A root of the cosine beside a half-odd power of a + a sec is integrated wrongly where the cosine is negative #1581; this rule answers them before that route is asked.(c + d sec)^2or^3below the bar, which master declined in 0.1 to 0.4 s, now run past the budget. Undertthey are a repeated quadratic beside the root, which nothing reduces yet. Both results are no answer.The unit tests pass on the merged build (net10.0, 13,514), every target builds, and the allocation gate passes.
🤖 Generated with Claude Code