Skip to content

A half-odd power of the secant beside the cosine is integrated as the cosine's - #1743

Merged
Rafael-SOWNet merged 2 commits into
masterfrom
a-power-of-the-secant-beside-the-cosine
Oct 4, 2026
Merged

Rafael-SOWNet merged 2 commits into
masterfrom
a-power-of-the-secant-beside-the-cosine

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

sec(x)^(3/2)/sqrt(1 + cos(x)) was declined, while 1/(cos(x)^(3/2) sqrt(1 + cos(x))), which it is wherever the cosine is positive, was answered: the substitutions that read a function of the cosine read the secant as 1/cos to a whole power only. 2.5.0 declined them too:

integrand 2.5.0 master 7075a747 this
sec(x)^(3/2)/sqrt(1 + cos(x)) declined declined after 0.6 s answered, in 1.8 s
sec(x)^(5/2) (a + a cos(x))^(3/2) declined declined after 1.6 s answered, in 2.9 s
(a + a cos(x))^(3/2) (A + B cos(x))/sqrt(sec(x)) declined declined after 17 s answered, in 2.2 s
sqrt(csc(x)) sqrt(a + a sin(x)) declined declined after 0.4 s answered, in 0.9 s

The times of this column include differentiating the answer back to check it.

What changes. A half-odd power of the secant beside the cosine of the same argument is written as the cosine's power on the other side of the bar, sec(x)^p = K/cos(x)^p, and the answer for that is multiplied by K = sec(x)^p cos(x)^p -- divided, for a power below the bar. K is 1 where the cosine is positive and -1 where it is negative, so the answer holds on both sides, and the integrand is real exactly where the rewritten one is. The same for the cosecant beside the sine. Only a half-odd power of the secant itself: a quarter, or a constant inside the power, makes K imaginary on one side and the integrand real where the rewritten one is not, where an answer for the rewritten one says nothing. Only beside the cosine, so that a power of the secant with no cosine keeps the rules for the secant.

Tests: PowerOfTheSecantBesideTheCosineIntegralTest, seven rows compared as complex numbers at points on both sides of the cosine's zeros; all seven are declined on master.

Measured first on the 819 problems with a fractional power of the secant beside the cosine, or of the cosecant beside the sine, of the same argument, 214 run, at the corpus's 5-second budget, against master 8f3757cd, the branch's base:

master this
solved 0 213
wrong 0 0
past the budget 40 0

Measured then on the Rubi corpus against master 8f3757cd:

master this
family 0, independent suites (1814) 1766 1766
family 1, 40 a file (1381) 1296 1294
families 2 to 8, sampled (2410) 2215 2220

No answer is wrong in the pocket or the sample on either build. Of the 225 problems the two builds disagreed on, pocket and sample together, run again one build at a time, master answers 4 and this 219: two hundred and eighteen of them powers of the secant or the cosecant beside the cosine or the sine, declined or past the budget on master. The three master answers alone, log(e (f (a + b x)^p (c + d x)^q)^r)/(a + b x)^4 and two of 3.2.1's, take twenty to twenty-four seconds there, at the edge of the harness's patience, and ran past it here this time. Family 1's two in the sample are x^4/((a + b x^2)^2 (c + d x^2)^3) and 1/(x (a x + b x^3 + c x^5)^2), past the budget on both builds run alone, with one more from family 4. All of these cross that edge one way or the other on every build.

The suite passes on the commit measured, 9c55cb46, 14,598 tests with 13 skipped, and the allocation gate with it. On the merge with master 7075a747, ea3b574f, the 4,104 calculus and corpus tests that run pass, with 2 skipped. Every row of the first table is as it says on the merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Rafael-SOWNet and others added 2 commits October 4, 2026 06:06
… cosine's

sec(x)^(3/2)/sqrt(1 + cos(x)) was declined while
1/(cos(x)^(3/2) sqrt(1 + cos(x))) was answered: the substitutions that
read a function of the cosine read the secant as 1/cos to a whole power
only. A half-odd power of the secant beside the cosine is written as the
cosine's on the other side of the bar, sec^p = K/cos^p, with
K = sec^p cos^p in front of the answer, which is 1 where the cosine is
positive and -1 where it is negative. The same for the cosecant beside
the sine. Rubi's 4.2.2.1, 4.2.3.1 and 4.2.4.2.

Part of #718.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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