Repository navigation
A trigonometric function times its reciprocal is integrated - #1768
Merged
Rafael-SOWNet merged 5 commits intoOct 5, 2026
Merged
Rafael-SOWNet merged 5 commits into
Rafael-SOWNet merged 5 commits into
Conversation
The rule for products of powers of the six trigonometric functions reads them as sin^p cos^q, and refused a product whose powers cancel: sin(x) csc(x), cos(x)^2 sec(x)^2 and tan(x) cot(x) were declined. That product is the constant wherever it is defined, and its integral the constant times x. The reader takes such a product where the rule asks for it; its other readers, which divide by a power, still decline it. (1 + cos(x)^2) sec(x)^2, Rubi's 4.7.7, is answered again. Part of #718. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
2.5.0 answered cos(x)^2 sec(x)^2, csc(x)^2 (1 + sin(x)^2) and (1 + cos(x)^2) sec(x)^2 at length, and declined only sin(x) csc(x) and tan(x) cot(x); the unreleased master declined all five. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…ction-times-its-reciprocal-is-integrated
…ction-times-its-reciprocal-is-integrated
…ction-times-its-reciprocal-is-integrated
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.
sin(x) csc(x)was declined, and so, on master, werecos(x)^2 sec(x)^2and Rubi's 4.7.7(1 + cos(x)^2) sec(x)^2, which 2.5.0 answered at length:763f7baesin(x) csc(x)xcos(x)^2 sec(x)^2cos(x)^2 tan(x) + x - sin(2x)/2xtan(x) cot(x)arctan(tan(x))x(1 + cos(x)^2) sec(x)^2cos(x)^2 tan(x) + x - sin(2x)/2 + tan(x)x + tan(x)csc(x)^2 (1 + sin(x)^2)-sin(x)^2 cot(x) + x + sin(2x)/2 - cot(x)x - cot(x)Each answer is differentiated back and compared with the integrand at six points from 0.31 to 2.41, either side of
pi/2; with that check, this branch takes 21 to 660 ms a row.What changes. The rule for products of powers of the six functions reads them as
sin^p cos^qand refused a product whose powers cancel,p = q = 0. That product is the constant wherever it is defined, and its integral the constant timesx. The reader takes such a product now where that rule asks for it; its other readers, which go on to divide by a power, still decline it, having nothing to divide.Tests:
TrigonometricTimesItsReciprocalIntegralTest, five rows differentiated back on both sides of the zeros and poles, and the three bare products answered as exactlyx.Measured first on all of Rubi's 4.7.7 and 4.7.1, 1,045 problems, at the corpus's 5-second budget, against master
287c69a7, the branch's base:Measured then on the Rubi corpus against master
287c69a7:The harness counts no answer wrong in the pocket or the sample on either build. The figures were measured with three other corpus runs on the machine. In the pocket the two answers gained are matched by two that master answered at twenty-four seconds and this ran past the harness's patience on; run again alone, both builds answer one of those. Of the 6 problems the two builds disagreed on, pocket and sample together, run again one build at a time, master answers 2 and this 4:
(1 + cos(x)^2) sec(x)^2andcsc(x)^2 (1 + sin(x)^2), in a third of a second and less, and a 1.1.2.4 rational function at twenty-three seconds, at the edge of the harness's patience, which master ran past. Master answers one that ran past it here,(A + B cos(x) + C sin(x))/(a + b cos(x) + c sin(x))^2, at twenty-four seconds, a row that has run past that edge on one build or the other in every measurement this week.The suite on the commit measured,
68278034, passed, 14,829 tests, and the allocation gate passed. The calculus and corpus tests pass on its merge with masterbf5d1a18, 4,204 of them, and the library builds fornetstandard2.0. The head here,86f447d4, merges master18038b0d, and gives every row of the first table the answer it says.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura