The arcsecant beside a root of x^2 - 1 is integrated right below -1 too - #1722
Merged
Rafael-SOWNet merged 2 commits intoOct 4, 2026
Merged
Rafael-SOWNet merged 2 commits into
Rafael-SOWNet merged 2 commits into
Conversation
Under x = sec(u), sqrt(x^2 - 1) is |tan(u)|, and on the arcsecant's range the tangent has the sign of x. It was written tan(u), so x arcsec(x)/sqrt(x^2 - 1) and its kin were answered right for x > 1 and with the integrand's negative for a derivative at every x < -1. The root carries the sign now, as the cosecant's and the cotangent's do, and a first power of the arcsecant beside it is left to parts as theirs is. The sign is written back as the argument's, which is the sign of x only for a positive slope and no constant. Part of #718. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
…itution-carries-the-sign-of-the-argument
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.
Under
x = sec(u), the substitution that undoes the arcsecant,sqrt(x^2 - 1)is|tan(u)|, and on the arcsecant's range the tangent has the sign ofx. It was writtentan(u), so these were answered right forx > 1and wrong for everyx < -1, where they are as real -- the derivative of the answer was the integrand's negative there:51cb049ax arcsec(x)/sqrt(x^2 - 1)x < -1arcsec(x)/(x^2 sqrt(x^2 - 1))x < -1arcsec(x)^2/(x sqrt(x^2 - 1))x < -1arcsec(x + 3)^2/((x + 3) sqrt((x + 3)^2 - 1))x < -4Checked with the library's own settings, the first three at
x = -2.7, -1.9, -1.3, 1.3, 2.6and the fourth atx = -6, -4.5, -1.5, -0.5, 0.5, 1.5: on master the derivative is the integrand's negative at every point below-1for the first three and below-4for the fourth, and right at the rest; here it is right at all of them.What changes. The secant's root carries a sign,
tan(u) sgn, as the cosecant's and the cotangent's already did, and a first power of the arcsecant beside it is left to parts as theirs is. The sign is written back as the argument's. The other two wrote theirs back as the sign ofx, which is the argument's only for a positive slope and no constant:arcsec(x + 3)has the sign ofx + 3, and atx = -1.5, where the fourth row is checked, the two differ. On 2.5.0 these were declined.Tests:
InverseSecantIntegralTest.BesideARootOnBothIntervals, nine rows -- Timofeev's, Charlwood's and the linear argument -- each differentiated back on both intervals. All nine fail on master.Measured first with
work/intbench'sIB_BOTHSIDES=1, which also compares at the negatives of its sample points, on the 314 problems with an arcsecant, an arccosecant or an arccotangent in them, against master8f3757cd, the branch's base:The eight are the arcsecant beside its root, Timofeev's and Charlwood's.
Measured then on the Rubi corpus against master
8f3757cd:No answer is wrong in the sample on either build. Of the eight problems the two builds disagreed on, run again one build at a time, three ran out of time on master and are answered here -- 5.5.1's
(a + b asec(c x))/(d + e x)^2and its cube, and one of 6.6.1's -- and one went the other way:sqrt(g sin(e + f x))/((c + d sin(e + f x)) sqrt(a + a sin(e + f x))), which has no arcsecant in it and takes 23 to 35 s on either build without a budget, at the edge of the corpus's. The other four are answered on both.The suite passes on the commit measured,
14893b8a, 14,600 tests, and so does the allocation gate. Master51cb049ais merged in since, without conflicts; the calculus tests pass on the merge, 3,992 of them, and the four rows above are right at every point on it.🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura