Skip to content

A power of csc - sin or sec - cos is integrated as sine and cosine powers - #1760

Merged
Rafael-SOWNet merged 3 commits into
masterfrom
a-difference-of-a-reciprocal-trigonometric-function-is-a-quotient
Oct 4, 2026
Merged

Rafael-SOWNet merged 3 commits into
masterfrom
a-difference-of-a-reciprocal-trigonometric-function-is-a-quotient

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Part of #718.

(csc(x) - sin(x))^(5/2) was declined, with the rest of Rubi's 4.7.7 to a power that is not whole of csc(x) - sin(x) or sec(x) - cos(x), either way up. 2.5.0 declined all sixteen; master answers the two square roots:

integrand 2.5.0 master a10be86c this
(csc(x) - sin(x))^(7/2) declined declined in 0.6 s
(csc(x) - sin(x))^(5/2) declined declined (cos(x)^2/sin(x))^(5/2) times powers of sin(x), in 0.1 s
(csc(x) - sin(x))^(3/2) declined declined in 0.06 s
(csc(x) - sin(x))^(1/2) declined answered answered, in 0.06 s
1/(csc(x) - sin(x))^(1/2) declined declined with a logarithm and an arctangent, in 0.1 s
1/(csc(x) - sin(x))^(7/2) declined declined in 0.1 s
(sec(x) - cos(x))^(5/2) declined declined in 0.1 s
1/(sec(x) - cos(x))^(3/2) declined declined in 0.2 s

Each answer is differentiated back and compared at x = -2.5, -1, 0.4, 1.1, 2.2, 4, as complex numbers: on some of those intervals the integrand is imaginary. The times include that.

What changes. csc(z) - sin(z) is cos(z)^2/sin(z) and sec(z) - cos(z) is sin(z)^2/cos(z). A new rule writes either difference, in either order, as that quotient and asks the same question, just before the rule that integrates a product of powers of the six functions, some not whole, through the tangent. That rule read only a constant times one function, or a whole power of one, inside each power. It now reads a constant times any product and quotient of whole powers of the six functions, so (cos(z)^2/sin(z))^(5/2) is cos(z)^5 sin(z)^(-5/2) to it, with the root of the quotient kept in front as the integrand writes it. The product counts as not whole, as before, only where some function's power in it is not: (a csc(z)^2)^(-7/2) is a whole power of the modulus of the cosecant, which the rule for an even power under a root answers with its sign.

Tests: DifferenceOfReciprocalFunctionsIntegralTest, seven rows differentiated back on both sides of the zeros of the sine and cosine; 2.5.0 declines all seven.

Measured first on the powers of products of the six functions in Rubi's 4.1.0 to 4.6.0 and the powers in 4.7.7, 615 problems, at the corpus's 5-second budget, against master 287c69a7, the branch's base:

master this
solved 588 602
wrong 0 0
past the budget 0 0

Measured then on the Rubi corpus against master 287c69a7:

master this
family 0, independent suites (1814) 1772 1772
family 1, 40 a file (1381) 1308 1304
families 2 to 8, sampled (2410) 2301 2297

The harness counts no answer wrong in the pocket or the sample on either build. The family figures were measured with three other corpus runs on the machine. Of the 23 problems the two builds disagreed on, pocket and sample together, run again one build at a time, master answers 9 and this 21. The fourteen more are 4.7.7's powers of the two differences that are neither whole nor a square root, the first table's rows among them. The other nine take seventeen to twenty-four seconds on master, at the edge of the harness's patience, and none is a power of the two differences: two of them ran past it here, and run again, twice on each build, both builds ran past it on both.

The suite on the commit measured, d4e5b61e, passed but for two rows of EvenPowerSignTest, which ask for the sign rule's form of 1/(a csc(x)^2)^(7/2) and 1/sqrt(a cot(x)^2): the product rule had taken them first, reading the outer power alone, and 521d6531 has it decide from each function's power. On that commit the pocket was run again, 602 of 615 again, and so were the 23; three more of the nine slow ones ran past the patience, with four other corpus runs on the machine. On the merge with master a10be86c, ec0ca899, the 4,184 calculus and corpus tests that run pass, with 2 skipped, and the library builds for netstandard2.0; the allocation gate passed on the commit measured. 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 3 commits October 4, 2026 16:07
…wers

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…on's power is not

`(a csc(z)^2)^(-7/2)` is a whole power of the modulus of the cosecant, which the
rule for an even power under a root answers with its sign; reading the outer
power alone, the product rule took it first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…eciprocal-trigonometric-function-is-a-quotient
@Rafael-SOWNet Rafael-SOWNet added this to the 2.6.0 milestone Oct 4, 2026
@Rafael-SOWNet
Rafael-SOWNet merged commit 9f2cc36 into master Oct 4, 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