Skip to content

Two half-odd powers of secant sums in the half angle's sine - #1828

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
secant-two-roots-half-sine
Oct 9, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
secant-two-roots-half-sine

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

sec(e + f x) sqrt(a + a sec(e + f x))/sqrt(c + d sec(e + f x)) was declined, with eight more of Rubi's 4.5.2.1 and 4.5.2.3 that are a half-odd power of a + a sec beside one of c + d sec. The half-angle tangent reads a root of the first sum and leaves the second as another root, which it declines. Written in the cosine instead,

a + a sec(y) = 2a cos(y/2)^2/cos(y),    c + d sec(y) = (c cos(y) + d)/cos(y)

so the two powers of cos(y) make a whole one, and in w = sin(y/2), where cos(y) = 1 - 2w^2 and dy = 2 dw/cos(y/2), what is left is rational beside the one root of c + d - 2c w^2, which is answered at once. SolveTwoHalfOddPowersOfSecantSumsByTheHalfAngleSine takes the secant's, the cosine's, the minus sign's (in cos(y/2)) and the cosecant's (by the complement). The constants are not written: the answer is the integrand times the antiderivative in w over what that differentiates back to, a quotient whose square is one. It is kept only where that square is one at the sampled points.

integrand 2.5.0 master e1a1a3fc this
sec(x) sqrt(a + a sec(x))/sqrt(c + d sec(x)) declined declined 1,294 characters, 0.2 s
sec(x) sqrt(c + d sec(x))/sqrt(a + a sec(x)) declined declined 1,049 characters, 0.3 s
sec(x)/(sqrt(a + a sec(x)) sqrt(c + d sec(x))) declined declined 1,560 characters, 0.2 s
sec(x)^2/(sqrt(a + a sec(x)) sqrt(c + d sec(x))) declined declined 13,563 characters, 1.6 s
sqrt(c + d sec(x))/sqrt(a + a sec(x)) declined declined 981 characters, 0.1 s

x above stands for e + f x, which is what was probed. The other four rows answer in 891 to 6,066 characters. The longest answers carry a case for each sign of the root's leading coefficient.

Tests: TwoRootsOfSecantSumsIntegralTest, five rows (shifted argument, minus sign, cosecant), each differentiated back and compared as a complex number at six real points.

Measured on every corpus problem with a secant or a cosecant in its integrand, 6,489 of them, at the corpus's 5-second budget, against master e1a1a3fc:

master this
solved 6363 6372
unevaluated 78 69
wrong 0 0
past the budget 38 38

Nine problems are answered here and not on master, five of 4.5.2.1 and four of 4.5.2.3, and none the other way. On the 6,363 both answer the time is 1,686 seconds on master and 1,477 here.

master this
family 0, independent suites (1814) 1782 1782
family 1, 40 a file (1381) 1341 1341
families 2 to 8, sampled (2410) 2330 2331

The harness counts no answer wrong in either. The nine problems the builds disagreed on, run again one build at a time: master answers none, this all nine.

The suite passes: 15,176 passed, 13 skipped, none failed. The allocation gate passes: every gated benchmark allocates what the baseline says. The library builds for every target.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 9, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 61fb760 into master Oct 9, 2026
34 checks passed
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